comparison src/syswait.h @ 30066:0c8b413f3f35

Use the autoconf recommended approach. Old code #if'd out in case we need to revert.
author Dave Love <fx@gnu.org>
date Wed, 05 Jul 2000 17:00:06 +0000
parents 02044b05d8e0
children d57d77adc6da
comparison
equal deleted inserted replaced
30065:f7069f998fab 30066:0c8b413f3f35
1 /* Define wait system call interface for Emacs. 1 /* Define wait system call interface for Emacs.
2 Copyright (C) 1993, 1994, 1995 Free Software Foundation, Inc. 2 Copyright (C) 1993, 1994, 1995, 2000 Free Software Foundation, Inc.
3 3
4 This file is part of GNU Emacs. 4 This file is part of GNU Emacs.
5 5
6 GNU Emacs is free software; you can redistribute it and/or modify 6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
20 20
21 /* Define the structure that the wait system call stores. 21 /* Define the structure that the wait system call stores.
22 On many systems, there is a structure defined for this. 22 On many systems, there is a structure defined for this.
23 But on vanilla-ish USG systems there is not. */ 23 But on vanilla-ish USG systems there is not. */
24 24
25 #ifndef EMACS_SYSWAIT_H
26 #define EMACS_SYSWAIT_H
27
25 #ifndef VMS 28 #ifndef VMS
29
30 /* Try the approach recommended by autoconf. If this doesn't cause
31 trouble anywhere, remove the original code, which is #if'd out
32 below. */
33
34 #if 1
35 #undef WAITTYPE
36 #define WAITTYPE int
37 #define WRETCODE(w) WEXITSTATUS (w)
38
39 #include <sys/types.h>
40 #if HAVE_SYS_WAIT_H
41 #include <sys/wait.h>
42 #endif
43
44 #if defined (HPUX) || defined (convex)
45 /* HPUX version 7 has broken definitions of these. */
46 /* pvogel@convex.com says the convex does too. */
47 #undef WTERMSIG
48 #undef WSTOPSIG
49 #undef WIFSTOPPED
50 #undef WIFSIGNALED
51 #undef WIFEXITED
52 #endif /* HPUX || convex */
53
54 #ifndef WEXITSTATUS
55 # define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8)
56 #endif
57 #ifndef WIFEXITED
58 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
59 #endif
60 #ifndef WIFSTOPPED
61 #define WIFSTOPPED(w) ((w&0377) == 0177)
62 #endif
63 #ifndef WIFSIGNALED
64 #define WIFSIGNALED(w) ((w&0377) != 0177 && (w&~0377) == 0)
65 #endif
66 #ifndef WIFEXITED
67 #define WIFEXITED(w) ((w&0377) == 0)
68 #endif
69 #ifndef WRETCODE
70 #define WRETCODE(w) (w >> 8)
71 #endif
72 #ifndef WSTOPSIG
73 #define WSTOPSIG(w) (w >> 8)
74 #endif
75 #ifndef WTERMSIG
76 #define WTERMSIG(w) (w & 0377)
77 #endif
78 #ifndef WCOREDUMP
79 #define WCOREDUMP(w) ((w&0200) != 0)
80 #endif
81
82 #else /* !1 */
83
26 #ifndef WAITTYPE 84 #ifndef WAITTYPE
27 85
28 #ifdef WAIT_USE_INT 86 #ifdef WAIT_USE_INT
29 /* Some systems have union wait in their header, but we should use 87 /* Some systems have union wait in their header, but we should use
30 int regardless of that. */ 88 int regardless of that. */
86 #endif 144 #endif
87 #endif /* BSD_SYSTEM || UNIPLUS || STRIDE || HPUX */ 145 #endif /* BSD_SYSTEM || UNIPLUS || STRIDE || HPUX */
88 #endif /* not WAIT_USE_INT */ 146 #endif /* not WAIT_USE_INT */
89 #endif /* no WAITTYPE */ 147 #endif /* no WAITTYPE */
90 148
149 #endif /* 1 */
150
91 #else /* VMS */ 151 #else /* VMS */
92 152
93 #define WAITTYPE int 153 #define WAITTYPE int
94 #define WIFSTOPPED(w) 0 154 #define WIFSTOPPED(w) 0
95 #define WIFSIGNALED(w) 0 155 #define WIFSIGNALED(w) 0
102 #include <iodef.h> 162 #include <iodef.h>
103 #include <clidef.h> 163 #include <clidef.h>
104 #include "vmsproc.h" 164 #include "vmsproc.h"
105 165
106 #endif /* VMS */ 166 #endif /* VMS */
167
168 #endif /* EMACS_SYSWAIT_H */