123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186 |
- #ifndef _SYS_WAIT_H
- #define _SYS_WAIT_H 1
- #include <features.h>
- __BEGIN_DECLS
- #include <signal.h>
- #if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8)
- # include <bits/waitflags.h>
- # ifdef __USE_MISC
- # if defined __GNUC__ && !defined __cplusplus
- # define __WAIT_INT(status) \
- (__extension__ (((union { __typeof(status) __in; int __i; }) \
- { .__in = (status) }).__i))
- # else
- # define __WAIT_INT(status) (*(const int *) &(status))
- # endif
- # if !defined __GNUC__ || __GNUC__ < 2 || defined __cplusplus
- # define __WAIT_STATUS void *
- # define __WAIT_STATUS_DEFN void *
- # else
- typedef union
- {
- union wait *__uptr;
- int *__iptr;
- } __WAIT_STATUS __attribute__ ((__transparent_union__));
- # define __WAIT_STATUS_DEFN int *
- # endif
- # else
- # define __WAIT_INT(status) (status)
- # define __WAIT_STATUS int *
- # define __WAIT_STATUS_DEFN int *
- # endif
- # include <bits/waitstatus.h>
- # define WEXITSTATUS(status) __WEXITSTATUS (__WAIT_INT (status))
- # define WTERMSIG(status) __WTERMSIG (__WAIT_INT (status))
- # define WSTOPSIG(status) __WSTOPSIG (__WAIT_INT (status))
- # define WIFEXITED(status) __WIFEXITED (__WAIT_INT (status))
- # define WIFSIGNALED(status) __WIFSIGNALED (__WAIT_INT (status))
- # define WIFSTOPPED(status) __WIFSTOPPED (__WAIT_INT (status))
- # ifdef __WIFCONTINUED
- # define WIFCONTINUED(status) __WIFCONTINUED (__WAIT_INT (status))
- # endif
- #endif
- #ifdef __USE_MISC
- # define WCOREFLAG __WCOREFLAG
- # define WCOREDUMP(status) __WCOREDUMP (__WAIT_INT (status))
- # define W_EXITCODE(ret, sig) __W_EXITCODE (ret, sig)
- # define W_STOPCODE(sig) __W_STOPCODE (sig)
- #endif
- #if defined __USE_XOPEN || defined __USE_XOPEN2K8
- typedef enum
- {
- P_ALL,
- P_PID,
- P_PGID
- } idtype_t;
- #endif
- extern __pid_t wait (__WAIT_STATUS __stat_loc);
- #ifdef __USE_MISC
- # define WAIT_ANY (-1)
- # define WAIT_MYPGRP 0
- #endif
- extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
- #if defined __USE_XOPEN || defined __USE_XOPEN2K8
- # ifndef __id_t_defined
- # include <bits/types.h>
- typedef __id_t id_t;
- # define __id_t_defined
- # endif
- # define __need_siginfo_t
- # include <bits/siginfo.h>
- extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
- int __options);
- #endif
- #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
- struct rusage;
- extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
- struct rusage * __usage) __THROWNL;
- #endif
- #ifdef __USE_MISC
- extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
- struct rusage *__usage) __THROWNL;
- #endif
- __END_DECLS
- #endif
|