发布时间:2013-02-27 08:43:35
一、管道1、管道(有亲缘关系)及有名管道(无亲缘)、信号、消息队列、共享内存、信号量、套接字。=====无名管道2、管道:是堵塞的;管道的读端存在时向管道中写入数据才有意义。具有固定的读端和写端。3、当一个管道建立pipe(fds)时,它会创建两个文件描述符 fds[0]和 fds[1]。.........【阅读全文】
发布时间:2013-01-24 22:12:06
/* int mkfifo(const char *pathname, mode_t mode); 创建命名管道,成功返回0,失败返回-1。 程序运寻则操作的内容存在于管道文件中,一退出内容则被清空了。 EEXIST:用于判断命名管道文件是否存在,存在就可以不用创建。 */#include <stdio.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#in.........【阅读全文】
发布时间:2013-01-24 22:11:46
/*int pipe(int filedes[2]);无名管道,返回0成功,返回-1失败*/ /*fd[0]为读端,fd[1]为写端,从尾部写头部读*/ #include #include #include #include #include #include #include #include /*int pip.........【阅读全文】