4626
|
1 /* Define wait system call interface for Emacs.
|
75227
|
2 Copyright (C) 1993, 1994, 1995, 2000, 2001, 2002, 2003, 2004,
|
100951
|
3 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
4626
|
4
|
|
5 This file is part of GNU Emacs.
|
|
6
|
94994
|
7 GNU Emacs is free software: you can redistribute it and/or modify
|
4626
|
8 it under the terms of the GNU General Public License as published by
|
94994
|
9 the Free Software Foundation, either version 3 of the License, or
|
|
10 (at your option) any later version.
|
4626
|
11
|
|
12 GNU Emacs is distributed in the hope that it will be useful,
|
|
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
15 GNU General Public License for more details.
|
|
16
|
|
17 You should have received a copy of the GNU General Public License
|
94994
|
18 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
|
4626
|
19
|
|
20 /* Define the structure that the wait system call stores.
|
|
21 On many systems, there is a structure defined for this.
|
|
22 But on vanilla-ish USG systems there is not. */
|
|
23
|
30066
|
24 #ifndef EMACS_SYSWAIT_H
|
|
25 #define EMACS_SYSWAIT_H
|
|
26
|
30465
|
27 #include <sys/types.h>
|
30066
|
28
|
41185
|
29 #ifdef HAVE_SYS_WAIT_H /* We have sys/wait.h with POSIXoid definitions. */
|
46865
|
30 #include <sys/wait.h>
|
|
31 #endif /* !HAVE_SYS_WAIT_H */
|
30465
|
32
|
|
33 #ifndef WCOREDUMP /* not POSIX */
|
|
34 #define WCOREDUMP(status) ((status) & 0x80)
|
30066
|
35 #endif
|
46865
|
36 #ifndef WEXITSTATUS
|
30465
|
37 #define WEXITSTATUS(status) (((status) & 0xff00) >> 8)
|
46865
|
38 #endif
|
|
39 #ifndef WIFEXITED
|
30465
|
40 #define WIFEXITED(status) (WTERMSIG(status) == 0)
|
46865
|
41 #endif
|
|
42 #ifndef WIFSTOPPED
|
30465
|
43 #define WIFSTOPPED(status) (((status) & 0xff) == 0x7f)
|
46865
|
44 #endif
|
|
45 #ifndef WIFSIGNALED
|
30465
|
46 #define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status))
|
46865
|
47 #endif
|
|
48 #ifndef WSTOPSIG
|
30465
|
49 #define WSTOPSIG(status) WEXITSTATUS(status)
|
46865
|
50 #endif
|
|
51 #ifndef WTERMSIG
|
30465
|
52 #define WTERMSIG(status) ((status) & 0x7f)
|
46865
|
53 #endif
|
30465
|
54
|
|
55 #undef WRETCODE
|
|
56 #define WRETCODE(status) WEXITSTATUS (status)
|
30066
|
57
|
|
58
|
|
59 #endif /* EMACS_SYSWAIT_H */
|
52401
|
60
|
|
61 /* arch-tag: 7e5d9719-ec66-4b6f-89bb-563eea16a899
|
|
62 (do not change this comment) */
|