#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <limits.h>
#define BUFES PIPE_BUF
int main(int argc, char **argv)
{
int fd;
int len;
char buf[BUFES];
mode_t mode =0666;
fd= open("fifo1",O_RDONLY);
if (fd<0){
perror("failed");
exit(1);
}
while(1)
{
if((len =read(fd,buf,BUFES))>0)
{
printf("%s ",buf);
}
}
close(fd);
exit(0);
return 0;
}