28 lines
351 B
C
28 lines
351 B
C
#include<stdio.h>
|
|
#include <unistd.h>
|
|
#include <stdlib.h>
|
|
#include <fcntl.h>
|
|
#include <sys/types.h>
|
|
#include <sys/stat.h>
|
|
#include<string.h>
|
|
|
|
int main()
|
|
{
|
|
int fd = 0;
|
|
int i = 20;
|
|
char r_buff[64] = {0};
|
|
|
|
fd = open("/dev/myfifo",O_RDWR);
|
|
|
|
|
|
while(i)
|
|
{
|
|
memset(r_buff,0,64);
|
|
read(fd,r_buff,64);
|
|
printf("%s",r_buff);
|
|
i--;
|
|
}
|
|
|
|
return 0;
|
|
}
|