notatty.c

来自「APUE(第二版)的随书源代码,与第一版的代码相比增加了一些章节的代码(详见第二」· C语言 代码 · 共 21 行

C
21
字号
#include	<stdio.h>/* * The following prints errno=25 (ENOTTY) under 4.3BSD and SVR2, * when stdout is redirected to a file. * Under SVR4 and 44BSD it works OK. */intmain(){	int			fd;	extern int	errno;	if ( (fd = open("/no/such/file", 0)) < 0) {		printf("open error: ");		printf("errno = %d\n", errno);	}	exit(0);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?