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