管道拥塞
#include?<stdio.h>
#include?<unistd.h>
int?main(int?argc,?char?**argv)
{
????????if(argc!=?2)
????????{???
????????????????printf("pipeconf?pathname\n");
????????????????return?-1;?
????????}???
????????printf("pipe_buf?:?%ld?\n",?pathconf(argv[1],?_PC_PIPE_BUF));
} 查看指定路徑(不同分區不一)的最大容納的管道字節數
[dengwei@localhost tmp]$ ./pipe_buf /tmp
pipe_buf : 4096
因此要注意不能一直往管道里面寫,要注意write 返回值,成功寫了多少字節.
#include?<unistd.h>
int?main(int?argc,?char?**argv)
{
????????if(argc!=?2)
????????{???
????????????????printf("pipeconf?pathname\n");
????????????????return?-1;?
????????}???
????????printf("pipe_buf?:?%ld?\n",?pathconf(argv[1],?_PC_PIPE_BUF));
} 查看指定路徑(不同分區不一)的最大容納的管道字節數
[dengwei@localhost tmp]$ ./pipe_buf /tmp
pipe_buf : 4096
因此要注意不能一直往管道里面寫,要注意write 返回值,成功寫了多少字節.
轉載于:https://www.cnblogs.com/no7dw/archive/2012/06/19/2555043.html
總結
- 上一篇: 委托的前世今生
- 下一篇: asp.net MVC3 弹出窗口里嵌一