figc.17
来自「unix环境编程」· 17 代码 · 共 26 行
17
26 行
#include "apue.h"#include <fcntl.h>intmain(void){ int i, n; int fd[2]; if (pipe(fd) < 0) err_sys("pipe error"); set_fl(fd[1], O_NONBLOCK); /* * Write 1 byte at a time until pipe is full. */ for (n = 0; ; n++) { if ((i = write(fd[1], "a", 1)) != 1) { printf("write ret %d, ", i); break; } } printf("pipe capacity = %d\n", n); exit(0);}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?