Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sys/types.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <stdio.h>
- #include <string.h>
- #include <errno.h>
- #include <stdlib.h>
- extern int errno;
- #define FIFO1 "/tmp/fifo.1"
- int main(){
- char buff[50];
- int fifo;
- if ((fifo = open(FIFO1, O_RDONLY)) < 0)
- perror("nie moze otworzyc fifo1 do czytania");
- int n=read(fifo,buff,sizeof(buff));
- if (n<=0)
- perror("blad zapisu do fifo");
- else{
- buff[n]='\0';
- write(1,buff,n);
- printf("\n");
- }
- exit(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment