匿名管道
来源:互联网 发布:联通软件研究院怎么样 编辑:程序博客网 时间:2024/04/30 04:13
//匿名管道//实现父子进程间的进程通信//发送简单少量无格式数据#include <stdio.h>#include <unistd.h>int main(){ pid_t child; int fd[2]; int iRead; int iWrite; //create pipe pipe(fd); //create child child = fork(); if(child == 0) { close(fd[1]); while(1) { read(fd[0],&iWrite,sizeof(iWrite)); printf("Shu zi %d \n",iWrite); } close(fd[0]); exit(0); } else { close(fd[0]); while(1) { printf("shu ru\n"); scanf("%d",&iRead); write(fd[1],&iRead,sizeof(iRead)); } close(fd[1]); } return 0;}
0 0
- 匿名管道
- 匿名管道
- 匿名管道
- 匿名管道
- 匿名管道
- 匿名管道
- 匿名管道
- 匿名管道
- 匿名管道
- 匿名管道
- 匿名管道
- 匿名管道
- 匿名管道、命名管道
- 匿名管道 与 命名管道
- 匿名管道与命名管道
- 匿名管道和命名管道
- IPC-管道(匿名管道)
- Windows匿名管道技术
- Linux(centOS6.5)下SVN的安装、配置及开机启动
- Java再学习-JVM类加载和执行机制
- 决策树算法预测森林植被
- SEO
- [剑指offer]数字在排序数组中出现的次数
- 匿名管道
- webStorm 3.0配置使用主题背景色等
- JAX-RS的参考实现:《使用 Jersey 和 Apache Tomcat 构建 RESTful Web 服务》
- poj 1269 Intersecting Lines
- 有名管道
- java多线程(对象和变量的并发访问)
- 信号
- sql server中的 SET NOCOUNT ON 的含义
- 提高C++程序运行效率的10个简单方法