Install msysDVLPR-1.0.0-alpha-1
[msysgit.git] / include / sys / wait.h
blob9dd8bf7dcd446fc738e1d4c3484770debdda6f33
1 /* sys/wait.h
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
9 details. */
11 #ifndef _SYS_WAIT_H
12 #define _SYS_WAIT_H
14 #include <sys/types.h>
15 #include <sys/resource.h>
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
21 #define WNOHANG 1
22 #define WUNTRACED 2
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
40 pid_t wait (int *);
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);
45 union wait
47 int w_status;
48 struct
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. */
53 unsigned int:16;
54 } __wait_terminated;
55 struct
57 unsigned int __w_stopval:8; /* W_STOPPED if stopped. */
58 unsigned int __w_stopsig:8; /* Stopping signal. */
59 unsigned int:16;
60 } __wait_stopped;
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
69 #ifdef __cplusplus
71 #endif
73 #endif