chiark / gitweb /
[PATCH] sync with latest version of klibc (0.107)
[elogind.git] / klibc / klibc / include / sys / wait.h
index cad6989bf76c1c5aab4b668efc6062eb73fdb9e2..4cfafc9408c4c7ed4c0c20d4ff545342f1b01711 100644 (file)
 
 #include <linux/wait.h>
 
+#define WEXITSTATUS(s) (((s) & 0xff00) >> 8)
+#define WTERMSIG(s)    ((s) & 0x7f)
+#define WIFEXITED(s)   (WTERMSIG(s) == 0)
+#define WIFSTOPPED(s)  (WTERMSIG(s) == 0x7f)
+/* Ugly hack to avoid multiple evaluation of "s" */
+#define WIFSIGNALED(s) (WTERMSIG((s)+1) >= 2)
+#define WCOREDUMP(s)   ((s) & 0x80)
+#define WSTOPSIG(s)    WEXITSTATUS(s)
+
 __extern pid_t wait(int *);
 __extern pid_t waitpid(pid_t, int *, int);
 __extern pid_t wait3(int *, int, struct rusage *);