File:  [MW Coherent from dump] / coherent / a / usr / bob / korn / wait.h
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Wed May 29 04:56:34 2019 UTC (7 years ago) by root
Branches: MarkWilliams, MAIN
CVS tags: relic, HEAD
coherent

/*
 * POSIX <sys/wait.h>
 */

#if __STDC__
#define	ARGS(args)	args
#else
#define	ARGS(args)	()
#endif

#if 1
typedef int pid_t;		/* belong in sys/types.h */
#endif

/* waitpid options */
#define WNOHANG		1	/* don't hang in wait */
#define WUNTRACED	2	/* tell about stopped, untraced children */

#define	WSTOPPED	0x7F	/* process is stopped */

#define WIFSTOPPED(x)	(((x)&0xFF) == 0x7F)
#define WIFSIGNALED(x)	(((x)&0xFF) != 0x7F && ((x)&0x7F) != 0)
#define WIFEXITED(x)	(((x)&0xFF) != 0x7F && ((x)&0x7F) == 0)
#define	WIFCORED(x)	(!!((x)&0x80)) /* non-standard */
#define	WEXITSTATUS(x)	((x)>>8&0xFF)
#define	WTERMSIG(x)	((x)&0x7F)
#define	WSTOPSIG(x)	((x)>>8&0xFF)

pid_t wait ARGS((int *statp));
#if _BSD
pid_t wait3 ARGS((int *statp, int options, Void *));
/* todo: does not emulate pid argument */
#define	waitpid(pid, sp, opts)	wait3(sp, opts, (Void*)NULL)
#else
pid_t waitpid ARGS((pid_t pid, int *statp, int options));
#endif


unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.