|
|
DataMuseum.dkPresents historical artifacts from the history of: RC9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - downloadIndex: @ T w
Length: 4516 (0x11a4)
Types: TextFile
Notes: @(#)wait.h 13.2 (RC International) 91/03/04 */
Names: »wait.h«
└─⟦50656ff4a⟧ Bits:30010538 TX 3.1 Coldstart
└─⟦bbf173f5c⟧ »0004«
└─⟦this⟧ »./usr/include/sys/wait.h«
/* @(#)wait.h 13.2 (RC International) 91/03/04 */
/* Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T */
/* All Rights Reserved */
/* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T */
/* The copyright notice above does not evidence any */
/* actual or intended publication of such source code. */
#ident "@(-)head.sys:wait.h 1.1.5.1"
#ifndef _WAIT_H
#define _WAIT_H
/*
* This file holds definitions relevent to the wait system call.
* Some of the options here are available only through the ``wait3''
* entry point; the old entry point with one argument has more fixed
* semantics, never returning status of unstopped children, hanging until
* a process terminates if any are outstanding, and never returns
* detailed information about process resource utilization (<vtimes.h>).
*/
/*
* Structure of the information in the first word returned by both
* wait and wait3. If w_stopval==WSTOPPED, then the second structure
* describes the information returned, else the first. See WUNTRACED below.
*/
union wait {
int w_status; /* used in syscall */
/*
* Terminated process status.
*/
struct {
unsigned short w_dummy1:16; /* 2 dummy byte for big ending*/
unsigned short w_Retcode:8; /* sig code if w_termsig!=0 */
/* or high byte of exit arg */
unsigned short w_Coredump:1; /* core dump indicator */
unsigned short w_Termsig:7; /* termination signal */
} w_T;
/*
* Stopped process status. Returned
* only for traced children unless requested
* with the WUNTRACED option bit.
*/
struct {
unsigned short w_dummy2:16; /* 2 dummy byte for big ending*/
unsigned short w_Stopsig:8; /* signal that stopped us */
unsigned short w_Stopval:8; /* == WSTOPPED if stopped */
} w_S;
/*
* exit value for wait
*/
struct {
unsigned short w_dummy2:16; /* 2 dummy byte for big ending*/
unsigned short w_Exitval:16 /* exit value for wait */
} w_U;
};
#define w_termsig w_T.w_Termsig
#define w_coredump w_T.w_Coredump
#define w_retcode w_T.w_Retcode
#define w_stopval w_S.w_Stopval
#define w_stopsig w_S.w_Stopsig
#define w_xstat w_U.w_Exitval
/*
* Option bits for argument of wait3 and waitpid. WNOHANG causes the
* wait to not hang if there are no stopped or terminated processes, rather
* returning an error indication in this case (pid==0). WUNTRACED
* indicates that the caller should receive status about untraced children
* which stop due to signals. If children are stopped and a wait without
* this option is done, it is as though they were still running... nothing
* about them is returned.
*/
#define WNOHANG 1 /* dont hang in wait */
#define WUNTRACED 2 /* tell about stopped, untraced children */
/*
* arguments to wait functions
*/
#if !defined(_POSIX_SOURCE)
#define WEXITED 0001 /* wait for processes that have exited */
#define WTRAPPED 0002 /* wait for processes stopped while tracing */
#define WSTOPPED 0004 /* wait for processes stopped by signals */
#define WCONTINUED 0010 /* wait for processes continued */
#endif /* !defined(_POSIX_SOURCE) */
#if !defined(_POSIX_SOURCE)
#define WNOWAIT 0200 /* non destructive form of wait */
#define WOPTMASK (WEXITED|WTRAPPED|WSTOPPED|WCONTINUED|WNOHANG|WNOWAIT)
/*
* macros for stat return from wait functions
*/
#define WCONTFLG 0177777
#define WCOREFLG 0200
#define WWORD(stat) ((int)((stat))&0177777)
#endif /* !defined(_POSIX_SOURCE) */
#if !defined(_POSIX_SOURCE)
#define WSTOPFLG 0177
#define WSIGMASK 0177
#define WLOBYTE(stat) ((int)((stat)&0377))
#define WHIBYTE(stat) ((int)(((stat)>>8)&0377))
#endif /* !defined(_POSIX_SOURCE) */
#define WIFEXITED(stat) (((int)((stat)&0377))==0)
#define WIFSIGNALED(stat) (((int)((stat)&0377))>0&&((int)(((stat)>>8)&0377))==0)
#define WIFSTOPPED(stat) (((int)((stat)&0377))==0177&&((int)(((stat)>>8)&0377))!=0)
#if !defined(_POSIX_SOURCE)
#define WIFCONTINUED(stat) (WWORD(stat)==WCONTFLG)
#endif /* !defined(_POSIX_SOURCE) */
#define WEXITSTATUS(stat) ((int)(((stat)>>8)&0377))
#define WTERMSIG(stat) (((int)((stat)&0377))&0177)
#define WSTOPSIG(stat) ((int)(((stat)>>8)&0377))
#if !defined(_POSIX_SOURCE)
#define WCOREDUMP(stat) ((stat)&WCOREFLG)
#endif /* !defined(_POSIX_SOURCE) */
#if defined(__STDC__)
extern pid_t wait(int *);
extern pid_t waitpid(pid_t, int *, int);
#else /* Not __STDC__ */
extern pid_t wait();
extern pid_t waitpid();
#if !defined(_POSIX_SOURCE)
extern int waitid();
#endif /* !defined(_POSIX_SOURCE) */
#endif /* __STDC__ */
#endif /* _WAIT_H */