|
|
|
|
出了管道的具体应用,父进程通过管道发送一些命令给子进程,子进程解析命令,并根据命令作相应处理。
#include
#include
main()
{
int pipe_fd.;
pid_t pid;
char r_buf.;
char** w_buf[256];
int childexit=0;
int i;
int cmd;
memset(r_buf,0,sizeof(r_buf));
if(pipe(pipe_fd)<0)
{
printf("pipe create error\n");
return -1;
页码:[1] [2] [3] [4] [5] [6] 第3页、共6页 |
|
|