123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173 |
- #ifndef _SYS_WAIT_H
- #define _SYS_WAIT_H 1
- #include <features.h>
- __BEGIN_DECLS
- #include <signal.h>
- #include <sys/resource.h>
- #if !defined _STDLIB_H || !defined __USE_XOPEN
- # include <bits/waitflags.h>
- # ifdef __USE_BSD
- # if defined __GNUC__ && !defined __cplusplus
- # define __WAIT_INT(status) \
- (__extension__ ({ union { __typeof(status) __in; int __i; } __u; \
- __u.__in = (status); __u.__i; }))
- # else
- # define __WAIT_INT(status) (*(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))
- #endif
- #ifdef __USE_BSD
- # 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_SVID || defined __USE_XOPEN
- typedef enum
- {
- P_ALL,
- P_PID,
- P_PGID
- } idtype_t;
- #endif
- extern __pid_t wait (__WAIT_STATUS __stat_loc) __THROW;
- #ifdef __USE_BSD
- # define WAIT_ANY (-1)
- # define WAIT_MYPGRP 0
- #endif
- extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options) __THROW;
- #if defined __USE_SVID || defined __USE_XOPEN
- # define __need_siginfo_t
- # include <bits/siginfo.h>
- extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
- int __options) __THROW;
- #endif
- #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
- struct rusage;
- extern __pid_t wait3 (__WAIT_STATUS __stat_loc, int __options,
- struct rusage * __usage) __THROW;
- #endif
- #ifdef __USE_BSD
- struct rusage;
- extern __pid_t wait4 (__pid_t __pid, __WAIT_STATUS __stat_loc, int __options,
- struct rusage *__usage) __THROW;
- #endif
- __END_DECLS
- #endif
|