3 Copyright 1997, 1998, 2001 Red Hat, Inc.
5 This file is part of Cygwin.
7 This software is a copyrighted work licensed under the terms of the
8 Cygwin license. Please consult the file "CYGWIN_LICENSE" for
14 #include <sys/types.h>
15 #include <sys/resource.h>
24 /* A status looks like:
25 <2 bytes info> <2 bytes code>
27 <code> == 0, child has exited, info is the exit value
28 <code> == 1..7e, child has exited, info is the signal number.
29 <code> == 7f, child has stopped, info was the signal number.
30 <code> == 80, there was a core dump.
33 #define WIFEXITED(w) (((w) & 0xff) == 0)
34 #define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f))
35 #define WIFSTOPPED(w) (((w) & 0xff) == 0x7f)
36 #define WEXITSTATUS(w) (((w) >> 8) & 0xff)
37 #define WTERMSIG(w) ((w) & 0x7f)
38 #define WSTOPSIG WEXITSTATUS
41 pid_t
waitpid (pid_t
, int *, int);
42 pid_t
wait3 (int *__status
, int __options
, struct rusage
*__rusage
);
43 pid_t
wait4 (pid_t __pid
, int *__status
, int __options
, struct rusage
*__rusage
);
50 unsigned int __w_termsig
:7; /* Terminating signal. */
51 unsigned int __w_coredump
:1; /* Set if dumped core. */
52 unsigned int __w_retcode
:8; /* Return code if exited normally. */
57 unsigned int __w_stopval
:8; /* W_STOPPED if stopped. */
58 unsigned int __w_stopsig
:8; /* Stopping signal. */
63 #define w_termsig __wait_terminated.__w_termsig
64 #define w_coredump __wait_terminated.__w_coredump
65 #define w_retcode __wait_terminated.__w_retcode
66 #define w_stopsig __wait_stopped.__w_stopsig
67 #define w_stopval __wait_stopped.__w_stopval