What makes the desert beautiful is that somewhere it hides a well.
沙漠之所以美丽,是因为在它的某个角落隐藏着一口井.
linux进程和进程通信编程(2)
进程间通信
1.管道通信
进程A和进程B是应用层的, 不能直接通信
管道就用于它们之间的通信, 管道存在于内核
不管有名还是无名, 只要管道里面没有内容, 使用read函数就会被阻塞
(1)有名管道
用于任何两个进程都可以
相关程序21write.c , 21read.c
mkfifo
//头文件
#include <sys/stat.h>
#include <unistd.h>