annotate src/syswait.h @ 18:d95e72db5c07 r19-15b92

Import from CVS: tag r19-15b92
author cvs
date Mon, 13 Aug 2007 08:49:43 +0200
parents 376386a54a3c
children 43dd3413c7c7
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /* Define wait system call interface for Emacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 Copyright (C) 1995 Sun Microsystems, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 /* Synched up with: FSF 19.30. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 /* Cleaned up by Ben Wing. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 /* Define the structure that the wait system call stores.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 On many systems, there is a structure defined for this.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 But on vanilla-ish USG systems there is not.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 NOTE: POSIX specifies that int, rather than union wait,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 be used. BSD systems based on BSD 4.3+ or newer generally
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 have int, but those based on BSD 4.3 or older have union wait.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 #ifndef VMS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 # ifdef HAVE_SYS_WAIT_H
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 # include <sys/wait.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 # if !defined (HAVE_UNION_WAIT) /* the POSIX / SYSV way */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 # define WAITTYPE int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 # ifndef WIFSTOPPED
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 # define WIFSTOPPED(w) (((w) & 0377) == 0177)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 # ifndef WIFSIGNALED
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 # define WIFSIGNALED(w) (((w) & 0377) != 0177 && ((w) & ~0377) == 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 # ifndef WIFEXITED
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 # define WIFEXITED(w) (((w) & 0377) == 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 # ifndef WRETCODE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 # ifdef WEXITSTATUS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 # define WRETCODE(w) WEXITSTATUS (w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 # define WRETCODE(w) ((w) >> 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 # ifndef WSTOPSIG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 # define WSTOPSIG(w) ((w) >> 8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 # ifndef WTERMSIG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 # define WTERMSIG(w) ((w) & 0377)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 # ifndef WCOREDUMP
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 # define WCOREDUMP(w) (((w) & 0200) != 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 # else /* the older BSD way */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 # define WAITTYPE union wait
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 # ifndef WRETCODE
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 # ifdef WEXITSTATUS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 # define WRETCODE(w) WEXITSTATUS(w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 # else
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 # define WRETCODE(w) w.w_retcode
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 # undef WCOREDUMP /* Later BSDs define this name differently. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 # define WCOREDUMP(w) w.w_coredump
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 # if defined (HPUX) || defined (convex)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 /* HPUX version 7 has broken definitions of these. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 /* pvogel@convex.com says the convex does too. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 # undef WTERMSIG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 # undef WSTOPSIG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 # undef WIFSTOPPED
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 # undef WIFSIGNALED
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 # undef WIFEXITED
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 # endif /* HPUX | convex */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 # ifndef WTERMSIG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 # define WTERMSIG(w) w.w_termsig
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 # ifndef WSTOPSIG
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 # define WSTOPSIG(w) w.w_stopsig
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 # ifndef WIFSTOPPED
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 # define WIFSTOPPED(w) (WTERMSIG (w) == 0177)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 # ifndef WIFSIGNALED
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 # define WIFSIGNALED(w) (WTERMSIG (w) != 0177 && (WSTOPSIG (w)) == 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 # ifndef WIFEXITED
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 # define WIFEXITED(w) (WTERMSIG (w) == 0)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 # endif /* HAVE_UNION_WAIT */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 #else /* VMS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 # define WAITTYPE int
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 # define WIFSTOPPED(w) 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 # define WIFSIGNALED(w) 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 # define WIFEXITED(w) ((w) != -1)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 # define WRETCODE(w) (w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 # define WSTOPSIG(w) (w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 # define WCOREDUMP(w) 0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 # define WTERMSIG(w) (w)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 # include <ssdef.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 # include <iodef.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 # include <clidef.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 # include "vmsproc.h"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 #endif /* VMS */