|
um=write(pipe_fd.,w_buf,1024))==-1)
printf("write to pipe error\n");
else
printf("the bytes write to pipe is %d \n", writenum);
writenum=write(pipe_fd.,w_buf,4096);
close(pipe_fd.);
}
}
输出结果:
the bytes write to pipe 1000
the bytes write to pipe 1000 //注意,此行输出说明了写入的非原子性
the bytes write to pipe 1000
the bytes write to pipe 1000
the byte页码:[1] [2] [3] [4] [5] [6] [7] 第5页、共7页 |