/* The following macros are defined equivalently to their definitions
in POSIX.1. We fail to define WNOHANG and WUNTRACED, which POSIX.1
<sys/wait.h> defines, since our code does not use waitpid() (but
- NOTE exception for Linux below).
- We also fail to declare wait() and waitpid(). */
+ NOTE exception for GNU/Linux below). We also fail to declare
+ wait() and waitpid(). */
#ifndef WIFEXITED
#define WIFEXITED(w) (((w)&0377) == 0)
#endif
#ifndef WSETEXIT
+# ifdef W_EXITCODE
+#define WSETEXIT(w,status) ((w) = W_EXITCODE(status,0))
+# else
#define WSETEXIT(w,status) ((w) = (0 | ((status) << 8)))
+# endif
#endif
#ifndef WSETSTOP
+# ifdef W_STOPCODE
+#define WSETSTOP(w,sig) ((w) = W_STOPCODE(sig))
+# else
#define WSETSTOP(w,sig) ((w) = (0177 | ((sig) << 8)))
+# endif
#endif
-/*
- * For native Linux we may use waitpid and the __WCLONE option.
- * <GRIPE> It is of course dangerous not to use the REAL header file...
- * </GRIPE>
- */
+/* For native GNU/Linux we may use waitpid and the __WCLONE option.
+ <GRIPE> It is of course dangerous not to use the REAL header file...
+ </GRIPE>. */
/* Bits in the third argument to `waitpid'. */
#ifndef WNOHANG