xref: /titanic_51/usr/src/lib/libast/amd64/include/ast/wait.h (revision bbaa8b60dd95d714741fc474adad3cf710ef4efd)
1 
2 /* : : generated by proto : : */
3 /***********************************************************************
4 *                                                                      *
5 *               This software is part of the ast package               *
6 *          Copyright (c) 1985-2010 AT&T Intellectual Property          *
7 *                      and is licensed under the                       *
8 *                  Common Public License, Version 1.0                  *
9 *                    by AT&T Intellectual Property                     *
10 *                                                                      *
11 *                A copy of the License is available at                 *
12 *            http://www.opensource.org/licenses/cpl1.0.txt             *
13 *         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
14 *                                                                      *
15 *              Information and Software Systems Research               *
16 *                            AT&T Research                             *
17 *                           Florham Park NJ                            *
18 *                                                                      *
19 *                 Glenn Fowler <gsf@research.att.com>                  *
20 *                  David Korn <dgk@research.att.com>                   *
21 *                   Phong Vo <kpv@research.att.com>                    *
22 *                                                                      *
23 ***********************************************************************/
24 
25 /*
26  * ast POSIX wait/exit support
27  */
28 
29 #ifndef _WAIT_H
30 #if !defined(__PROTO__)
31 #include <prototyped.h>
32 #endif
33 #if !defined(__LINKAGE__)
34 #define __LINKAGE__		/* 2004-08-11 transition */
35 #endif
36 
37 #define _WAIT_H
38 
39 #include <ast.h>
40 #include <ast_wait.h>
41 
42 #if _sys_wait
43 #if defined(__STDPP__directive) && defined(__STDPP__hide)
44 __STDPP__directive pragma pp:hide wait waitpid
45 #else
46 #define wait		______wait
47 #define waitpid		______waitpid
48 #endif
49 #include <sys/wait.h>
50 #if defined(__STDPP__directive) && defined(__STDPP__hide)
51 __STDPP__directive pragma pp:nohide wait waitpid
52 #else
53 #undef	wait
54 #undef	waitpid
55 #endif
56 #endif
57 
58 #ifndef WNOHANG
59 #define WNOHANG		1
60 #endif
61 
62 #ifndef WUNTRACED
63 #define WUNTRACED	2
64 #endif
65 
66 #if !_ok_wif
67 #undef	WIFEXITED
68 #undef	WEXITSTATUS
69 #undef	WIFSIGNALED
70 #undef	WTERMSIG
71 #undef	WIFSTOPPED
72 #undef	WSTOPSIG
73 #undef	WTERMCORE
74 #endif
75 
76 #ifndef WIFEXITED
77 #define WIFEXITED(x)	(!((x)&((1<<(EXIT_BITS-1))-1)))
78 #endif
79 
80 #ifndef WEXITSTATUS
81 #define WEXITSTATUS(x)	(((x)>>EXIT_BITS)&((1<<EXIT_BITS)-1))
82 #endif
83 
84 #ifndef WIFSIGNALED
85 #define WIFSIGNALED(x)	(((x)&((1<<(EXIT_BITS-1))-1))!=0)
86 #endif
87 
88 #ifndef WTERMSIG
89 #define WTERMSIG(x)	((x)&((1<<(EXIT_BITS-1))-1))
90 #endif
91 
92 #ifndef WIFSTOPPED
93 #define WIFSTOPPED(x)	(((x)&((1<<EXIT_BITS)-1))==((1<<(EXIT_BITS-1))-1))
94 #endif
95 
96 #ifndef WSTOPSIG
97 #define WSTOPSIG(x)	WEXITSTATUS(x)
98 #endif
99 
100 #ifndef WTERMCORE
101 #define WTERMCORE(x)	((x)&(1<<(EXIT_BITS-1)))
102 #endif
103 
104 extern __MANGLE__ pid_t		wait __PROTO__((int*));
105 extern __MANGLE__ pid_t		waitpid __PROTO__((pid_t, int*, int));
106 
107 #endif
108