⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sizepipe.c

📁 UNIX环境高级编程第二版(英文版)配书的源代码
💻 C
字号:
#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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -