27 |
|
|
28 |
#ifndef VMS |
#ifndef VMS |
29 |
|
|
30 |
/* Try the approach recommended by autoconf. If this doesn't cause |
/* This is now really the approach recommended by Autoconf. If this |
31 |
trouble anywhere, remove the original code, which is #if'd out |
doesn't cause trouble anywhere, remove the original code, which is |
32 |
below. */ |
#if'd out below. */ |
33 |
|
|
34 |
#if 1 |
#if 1 |
35 |
#include <sys/types.h> |
#include <sys/types.h> |
36 |
|
|
37 |
#ifdef HAVE_SYS_WAIT_H /* We have sys/wait.h with POSIXoid definitions. */ |
#ifdef HAVE_SYS_WAIT_H /* We have sys/wait.h with POSIXoid definitions. */ |
|
|
|
38 |
#include <sys/wait.h> |
#include <sys/wait.h> |
39 |
|
#endif /* !HAVE_SYS_WAIT_H */ |
40 |
|
|
41 |
#ifndef WCOREDUMP /* not POSIX */ |
#ifndef WCOREDUMP /* not POSIX */ |
42 |
#define WCOREDUMP(status) ((status) & 0x80) |
#define WCOREDUMP(status) ((status) & 0x80) |
43 |
#endif |
#endif |
44 |
|
#ifndef WEXITSTATUS |
|
#else /* !HAVE_SYS_WAIT_H */ |
|
|
|
|
|
/* Note that sys/wait.h may still be included by stdlib.h or something |
|
|
according to XPG. */ |
|
|
|
|
|
#undef WEXITSTATUS |
|
45 |
#define WEXITSTATUS(status) (((status) & 0xff00) >> 8) |
#define WEXITSTATUS(status) (((status) & 0xff00) >> 8) |
46 |
#undef WIFEXITED |
#endif |
47 |
|
#ifndef WIFEXITED |
48 |
#define WIFEXITED(status) (WTERMSIG(status) == 0) |
#define WIFEXITED(status) (WTERMSIG(status) == 0) |
49 |
#undef WIFSTOPPED |
#endif |
50 |
|
#ifndef WIFSTOPPED |
51 |
#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) |
#define WIFSTOPPED(status) (((status) & 0xff) == 0x7f) |
52 |
#undef WIFSIGNALED |
#endif |
53 |
|
#ifndef WIFSIGNALED |
54 |
#define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) |
#define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status)) |
55 |
#undef WSTOPSIG |
#endif |
56 |
|
#ifndef WSTOPSIG |
57 |
#define WSTOPSIG(status) WEXITSTATUS(status) |
#define WSTOPSIG(status) WEXITSTATUS(status) |
58 |
#undef WTERMSIG |
#endif |
59 |
|
#ifndef WTERMSIG |
60 |
#define WTERMSIG(status) ((status) & 0x7f) |
#define WTERMSIG(status) ((status) & 0x7f) |
61 |
#undef WCOREDUMP |
#endif |
|
#define WCOREDUMP(status) ((status) & 0x80) |
|
|
#endif /* HAVE_SYS_WAIT_H */ |
|
62 |
|
|
63 |
#undef WAITTYPE |
#undef WAITTYPE |
64 |
#define WAITTYPE int |
#define WAITTYPE int |
65 |
#undef WRETCODE |
#undef WRETCODE |
66 |
#define WRETCODE(status) WEXITSTATUS (status) |
#define WRETCODE(status) WEXITSTATUS (status) |
67 |
|
|
68 |
#else /* !1 */ |
#else /* 0 */ |
69 |
|
|
70 |
#ifndef WAITTYPE |
#ifndef WAITTYPE |
71 |
|
|
90 |
#define WCOREDUMP(w) ((w&0200) != 0) |
#define WCOREDUMP(w) ((w&0200) != 0) |
91 |
#endif |
#endif |
92 |
|
|
93 |
#else |
#else |
94 |
|
|
95 |
#ifdef BSD4_1 |
#ifdef BSD4_1 |
96 |
#include <wait.h> |
#include <wait.h> |
132 |
#endif /* not WAIT_USE_INT */ |
#endif /* not WAIT_USE_INT */ |
133 |
#endif /* no WAITTYPE */ |
#endif /* no WAITTYPE */ |
134 |
|
|
135 |
#endif /* 1 */ |
#endif /* 0 */ |
136 |
|
|
137 |
#else /* VMS */ |
#else /* VMS */ |
138 |
|
|