Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Basato sul programma originale di <[email protected]>
- * disponibile qui http://mij.oltrelinux.com/devel/unixprg/
- */
- #include <stdio.h>
- #include <stdlib.h>
- #include <fcntl.h>
- #include <sys/types.h>
- #include <sys/uio.h>
- #include <unistd.h>
- #define MAX_BUF 20
- int main(int argc, char *argv[]) {
- int pipe;
- char buf[MAX_BUF];
- pipe = open("pippo_pipe", O_RDONLY);
- if (pipe < 0) { perror("ERR: Apertura pipe"); exit(1);}
- read(pipe, buf, MAX_BUF);
- printf("Ricevuto: %s\n", buf);
- close(pipe);
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement