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

📄 waitnb.c

📁 早期freebsd实现
💻 C
字号:
/*  $Revision: 1.3 $***/#include <stdio.h>#include <sys/types.h>#include "configdata.h"#include <sys/wait.h>#if	defined(DO_USE_UNION_WAIT)typedef union wait	WAITER;#if	defined(WEXITSTATUS)#define WAITVAL(x)	(WEXITSTATUS(x))#else#define WAITVAL(x)	((x).w_retcode)#endif	/* defined(WEXITSTATUS) */#elsetypedef int		WAITER;#define WAITVAL(x)	(((x) >> 8) & 0xFF)#endif	/* defined(DO_USE_UNION_WAIT) */intwaitnb(statusp)    int		*statusp;{    WAITER	w;    int		pid;#if	defined(DO_HAVE_WAITPID)    pid = waitpid(-1, &w, WNOHANG);#endif	/* defined(DO_HAVE_WAITPID) */#if	defined(DONT_HAVE_WAITPID)    pid = wait3(&w, WNOHANG, (struct rusage *)NULL);#endif	/* defined(DONT_HAVE_WAITPID) */    if (pid > 0)	*statusp = WAITVAL(w);    return pid;}

⌨️ 快捷键说明

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