摘要:
#include <unistd.h> #include <stdlib.h>#include <stdio.h>#include <string.h>#define INPUT 0 #define OUTPUT 1 int main() { int file_descriptors[2]; /*定义子进程号 */ pid_t pid; char buf[256]; int returned_count; /*创建无名管道*/ pipe(file_descriptors); /*创建子进程*/ if((pid = fork()) == -1) { 阅读全文