1: /* $Header: /home/hyperion/mu/christos/src/sys/tcsh-6.00/RCS/tc.wait.h,v 3.0 1991/07/04 21:49:28 christos Exp $ */
2: /*
3: * tc.wait.h: Wait.h for machines that don't have it or have it and
4: * is incorrect.
5: */
6: /*-
7: * Copyright (c) 1980, 1991 The Regents of the University of California.
8: * All rights reserved.
9: *
10: * Redistribution and use in source and binary forms, with or without
11: * modification, are permitted provided that the following conditions
12: * are met:
13: * 1. Redistributions of source code must retain the above copyright
14: * notice, this list of conditions and the following disclaimer.
15: * 2. Redistributions in binary form must reproduce the above copyright
16: * notice, this list of conditions and the following disclaimer in the
17: * documentation and/or other materials provided with the distribution.
18: * 3. All advertising materials mentioning features or use of this software
19: * must display the following acknowledgement:
20: * This product includes software developed by the University of
21: * California, Berkeley and its contributors.
22: * 4. Neither the name of the University nor the names of its contributors
23: * may be used to endorse or promote products derived from this software
24: * without specific prior written permission.
25: *
26: * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27: * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29: * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30: * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31: * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32: * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33: * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34: * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35: * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36: * SUCH DAMAGE.
37: */
38: #ifndef _h_tc_wait
39: #define _h_tc_wait
40:
41: /*
42: * This wait is for big-endians and little endians
43: */
44: union wait {
45: int w_status;
46: # ifdef _SEQUENT_
47: struct {
48: unsigned short w_Termsig:7;
49: unsigned short w_Coredump:1;
50: unsigned short w_Retcode:8;
51: } w_T;
52: struct {
53: unsigned short w_Stopval:8;
54: unsigned short w_Stopsig:8;
55: } w_S;
56: };
57:
58: # define w_termsig w_T.w_Termsig
59: # define w_coredump w_T.w_Coredump
60: # define w_retcode w_T.w_Retcode
61: # define w_stopval w_S.w_Stopval
62: # define w_stopsig w_S.w_Stopsig
63: #else /* _SEQUENT_ */
64: # if defined(vax) || defined(i386)
65: union {
66: struct {
67: unsigned int w_Termsig:7;
68: unsigned int w_Coredump:1;
69: unsigned int w_Retcode:8;
70: unsigned int w_Dummy:16;
71: } w_T;
72: struct {
73: unsigned int w_Stopval:8;
74: unsigned int w_Stopsig:8;
75: unsigned int w_Dummy:16;
76: } w_S;
77: } w_P;
78: # else /* mc68000 || sparc || ??? */
79: union {
80: struct {
81: unsigned int w_Dummy:16;
82: unsigned int w_Retcode:8;
83: unsigned int w_Coredump:1;
84: unsigned int w_Termsig:7;
85: } w_T;
86: struct {
87: unsigned int w_Dummy:16;
88: unsigned int w_Stopsig:8;
89: unsigned int w_Stopval:8;
90: } w_S;
91: } w_P;
92: # endif /* vax || i386 */
93: };
94:
95: # define w_termsig w_P.w_T.w_Termsig
96: # define w_coredump w_P.w_T.w_Coredump
97: # define w_retcode w_P.w_T.w_Retcode
98: # define w_stopval w_P.w_S.w_Stopval
99: # define w_stopsig w_P.w_S.w_Stopsig
100: #endif /* _SEQUENT_ */
101:
102:
103: #ifndef WNOHANG
104: # define WNOHANG 1 /* dont hang in wait */
105: #endif
106: # ifndef WUNTRACED
107: # define WUNTRACED 2 /* tell about stopped, untraced children */
108: # endif
109: # define WSTOPPED 0177
110: # define WIFSTOPPED(x) ((x).w_stopval == WSTOPPED)
111: # define WIFSIGNALED(x) (((x).w_stopval != WSTOPPED) && ((x).w_termsig != 0))
112: #endif /* _h_tc_wait */
Defined union's
wait
defined in line
44;
never used
Defined macros
Usage of this include