![](https://csdnimg.cn/release/download_crawler_static/87512602/bg1.jpg)
5-23
代码:
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#define FIFO "/root/myfifo"
// 读端
void main1()
{
char lhqbuf_r[100];
int lhqfd;
int lhqnread;
//* 创建管道 * /
if ((mkfifo(FIFO, O_CREAT | O_EXCL) < 0) &&
(errno != EEXIST))
printf("lhq cannot create fifoserver ");