prexit.c

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

C
23
字号
#include	<sys/types.h>#include	<sys/wait.h>#include	"ourhdr.h"voidpr_exit(int status){	if (WIFEXITED(status))		printf("normal termination, exit status = %d\n",				WEXITSTATUS(status));	else if (WIFSIGNALED(status))		printf("abnormal termination, signal number = %d%s\n",				WTERMSIG(status),#ifdef	WCOREDUMP				WCOREDUMP(status) ? " (core file generated)" : "");#else				"");#endif	else if (WIFSTOPPED(status))		printf("child stopped, signal number = %d\n",				WSTOPSIG(status));}

⌨️ 快捷键说明

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