dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / lib / libast / common / include / wait.h
blobb50e6f0be2359e3c3682bd314bba5492dcfbe3af
1 /***********************************************************************
2 * *
3 * This software is part of the ast package *
4 * Copyright (c) 1985-2010 AT&T Intellectual Property *
5 * and is licensed under the *
6 * Common Public License, Version 1.0 *
7 * by AT&T Intellectual Property *
8 * *
9 * A copy of the License is available at *
10 * http://www.opensource.org/licenses/cpl1.0.txt *
11 * (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) *
12 * *
13 * Information and Software Systems Research *
14 * AT&T Research *
15 * Florham Park NJ *
16 * *
17 * Glenn Fowler <gsf@research.att.com> *
18 * David Korn <dgk@research.att.com> *
19 * Phong Vo <kpv@research.att.com> *
20 * *
21 ***********************************************************************/
22 #pragma prototyped
24 * ast POSIX wait/exit support
27 #ifndef _WAIT_H
28 #define _WAIT_H
30 #include <ast.h>
31 #include <ast_wait.h>
33 #if _sys_wait
34 #if defined(__STDPP__directive) && defined(__STDPP__hide)
35 __STDPP__directive pragma pp:hide wait waitpid
36 #else
37 #define wait ______wait
38 #define waitpid ______waitpid
39 #endif
40 #include <sys/wait.h>
41 #if defined(__STDPP__directive) && defined(__STDPP__hide)
42 __STDPP__directive pragma pp:nohide wait waitpid
43 #else
44 #undef wait
45 #undef waitpid
46 #endif
47 #endif
49 #ifndef WNOHANG
50 #define WNOHANG 1
51 #endif
53 #ifndef WUNTRACED
54 #define WUNTRACED 2
55 #endif
57 #if !_ok_wif
58 #undef WIFEXITED
59 #undef WEXITSTATUS
60 #undef WIFSIGNALED
61 #undef WTERMSIG
62 #undef WIFSTOPPED
63 #undef WSTOPSIG
64 #undef WTERMCORE
65 #endif
67 #ifndef WIFEXITED
68 #define WIFEXITED(x) (!((x)&((1<<(EXIT_BITS-1))-1)))
69 #endif
71 #ifndef WEXITSTATUS
72 #define WEXITSTATUS(x) (((x)>>EXIT_BITS)&((1<<EXIT_BITS)-1))
73 #endif
75 #ifndef WIFSIGNALED
76 #define WIFSIGNALED(x) (((x)&((1<<(EXIT_BITS-1))-1))!=0)
77 #endif
79 #ifndef WTERMSIG
80 #define WTERMSIG(x) ((x)&((1<<(EXIT_BITS-1))-1))
81 #endif
83 #ifndef WIFSTOPPED
84 #define WIFSTOPPED(x) (((x)&((1<<EXIT_BITS)-1))==((1<<(EXIT_BITS-1))-1))
85 #endif
87 #ifndef WSTOPSIG
88 #define WSTOPSIG(x) WEXITSTATUS(x)
89 #endif
91 #ifndef WTERMCORE
92 #define WTERMCORE(x) ((x)&(1<<(EXIT_BITS-1)))
93 #endif
95 extern pid_t wait(int*);
96 extern pid_t waitpid(pid_t, int*, int);
98 #endif