Mercurial > hg > xemacs-beta
comparison src/syswait.h @ 155:43dd3413c7c7 r20-3b4
Import from CVS: tag r20-3b4
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:39:39 +0200 |
parents | 376386a54a3c |
children | 15872534500d |
comparison
equal
deleted
inserted
replaced
154:94141801dd7e | 155:43dd3413c7c7 |
---|---|
17 You should have received a copy of the GNU General Public License | 17 You should have received a copy of the GNU General Public License |
18 along with XEmacs; see the file COPYING. If not, write to | 18 along with XEmacs; see the file COPYING. If not, write to |
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 Boston, MA 02111-1307, USA. */ | 20 Boston, MA 02111-1307, USA. */ |
21 | 21 |
22 /* Synched up with: FSF 19.30. */ | 22 /* Cleanup by Martin Buchholz for Autoconf 2 (see the Autoconf Manual) */ |
23 | 23 |
24 /* Cleaned up by Ben Wing. */ | 24 #include <sys/types.h> |
25 | 25 |
26 /* Define the structure that the wait system call stores. | 26 #ifdef HAVE_SYS_WAIT_H |
27 On many systems, there is a structure defined for this. | 27 #include <sys/wait.h> |
28 But on vanilla-ish USG systems there is not. | 28 #endif |
29 | 29 |
30 NOTE: POSIX specifies that int, rather than union wait, | 30 #ifndef WEXITSTATUS |
31 be used. BSD systems based on BSD 4.3+ or newer generally | 31 #define WEXITSTATUS(s) ((s) >> 8) |
32 have int, but those based on BSD 4.3 or older have union wait. | 32 #endif |
33 */ | 33 #ifndef WIFEXITED |
34 | 34 #define WIFEXITED(s) (((s) & 0xff) == 0) |
35 #ifndef VMS | 35 #endif |
36 | 36 #ifndef WIFSTOPPED |
37 # ifdef HAVE_SYS_WAIT_H | 37 #define WIFSTOPPED(s) (((s) & 0xff) == 0x7f) |
38 # include <sys/wait.h> | 38 #endif |
39 # endif | 39 #ifndef WIFSIGNALED |
40 | 40 #define WIFSIGNALED(s) (((unsigned int)((s)-1) & 0xffff) < 0xff) |
41 # if !defined (HAVE_UNION_WAIT) /* the POSIX / SYSV way */ | 41 #endif |
42 | 42 #ifndef WCOREDUMP |
43 # define WAITTYPE int | 43 #define WCOREDUMP(s) ((s) & 0200) |
44 # ifndef WIFSTOPPED | 44 #endif |
45 # define WIFSTOPPED(w) (((w) & 0377) == 0177) | 45 #ifndef WTERMSIG |
46 # endif | 46 #define WTERMSIG(s) ((s) & 0x7f) |
47 # ifndef WIFSIGNALED | 47 #endif |
48 # define WIFSIGNALED(w) (((w) & 0377) != 0177 && ((w) & ~0377) == 0) | 48 #ifndef WSTOPSIG |
49 # endif | 49 #define WSTOPSIG(s) ((s) >> 8) |
50 # ifndef WIFEXITED | 50 #endif |
51 # define WIFEXITED(w) (((w) & 0377) == 0) | |
52 # endif | |
53 # ifndef WRETCODE | |
54 # ifdef WEXITSTATUS | |
55 # define WRETCODE(w) WEXITSTATUS (w) | |
56 # else | |
57 # define WRETCODE(w) ((w) >> 8) | |
58 # endif | |
59 # endif | |
60 # ifndef WSTOPSIG | |
61 # define WSTOPSIG(w) ((w) >> 8) | |
62 # endif | |
63 # ifndef WTERMSIG | |
64 # define WTERMSIG(w) ((w) & 0377) | |
65 # endif | |
66 # ifndef WCOREDUMP | |
67 # define WCOREDUMP(w) (((w) & 0200) != 0) | |
68 # endif | |
69 | |
70 # else /* the older BSD way */ | |
71 | |
72 # define WAITTYPE union wait | |
73 | |
74 # ifndef WRETCODE | |
75 # ifdef WEXITSTATUS | |
76 # define WRETCODE(w) WEXITSTATUS(w) | |
77 # else | |
78 # define WRETCODE(w) w.w_retcode | |
79 # endif | |
80 # endif | |
81 | |
82 # undef WCOREDUMP /* Later BSDs define this name differently. */ | |
83 # define WCOREDUMP(w) w.w_coredump | |
84 | |
85 # if defined (HPUX) || defined (convex) | |
86 /* HPUX version 7 has broken definitions of these. */ | |
87 /* pvogel@convex.com says the convex does too. */ | |
88 # undef WTERMSIG | |
89 # undef WSTOPSIG | |
90 # undef WIFSTOPPED | |
91 # undef WIFSIGNALED | |
92 # undef WIFEXITED | |
93 # endif /* HPUX | convex */ | |
94 | |
95 # ifndef WTERMSIG | |
96 # define WTERMSIG(w) w.w_termsig | |
97 # endif | |
98 # ifndef WSTOPSIG | |
99 # define WSTOPSIG(w) w.w_stopsig | |
100 # endif | |
101 # ifndef WIFSTOPPED | |
102 # define WIFSTOPPED(w) (WTERMSIG (w) == 0177) | |
103 # endif | |
104 # ifndef WIFSIGNALED | |
105 # define WIFSIGNALED(w) (WTERMSIG (w) != 0177 && (WSTOPSIG (w)) == 0) | |
106 # endif | |
107 # ifndef WIFEXITED | |
108 # define WIFEXITED(w) (WTERMSIG (w) == 0) | |
109 # endif | |
110 | |
111 # endif /* HAVE_UNION_WAIT */ | |
112 | |
113 #else /* VMS */ | |
114 | |
115 # define WAITTYPE int | |
116 # define WIFSTOPPED(w) 0 | |
117 # define WIFSIGNALED(w) 0 | |
118 # define WIFEXITED(w) ((w) != -1) | |
119 # define WRETCODE(w) (w) | |
120 # define WSTOPSIG(w) (w) | |
121 # define WCOREDUMP(w) 0 | |
122 # define WTERMSIG(w) (w) | |
123 # include <ssdef.h> | |
124 # include <iodef.h> | |
125 # include <clidef.h> | |
126 # include "vmsproc.h" | |
127 | |
128 #endif /* VMS */ |