From 184574d61c070013956f739c074649b2e3e86eff Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 12 Jun 2006 14:25:05 +0000 Subject: * include/sys/wait.h: Move definition of wait constants from here... * include/cygwin/wait.h: ...to here. New file. * include/cygwin/stdlib.h: Include cygwin/wait.h to conform with SUSv3. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/include/cygwin/stdlib.h | 5 ++++- winsup/cygwin/include/cygwin/wait.h | 34 ++++++++++++++++++++++++++++++++++ winsup/cygwin/include/sys/wait.h | 23 ++--------------------- 4 files changed, 46 insertions(+), 22 deletions(-) create mode 100644 winsup/cygwin/include/cygwin/wait.h (limited to 'winsup') diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b9eabbb22..5d7d86dd9 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2006-06-12 Corinna Vinschen + + * include/sys/wait.h: Move definition of wait constants from here... + * include/cygwin/wait.h: ...to here. New file. + * include/cygwin/stdlib.h: Include cygwin/wait.h to conform with SUSv3. + 2006-06-12 Pierre Humblet Pierre.Humblet@ieee.org * heap.cc (heap_init): Only commit if allocsize is not zero. diff --git a/winsup/cygwin/include/cygwin/stdlib.h b/winsup/cygwin/include/cygwin/stdlib.h index 6ccc1ea8b..880051018 100644 --- a/winsup/cygwin/include/cygwin/stdlib.h +++ b/winsup/cygwin/include/cygwin/stdlib.h @@ -1,6 +1,6 @@ /* stdlib.h - Copyright 2005 Red Hat Inc. + Copyright 2005, 2006 Red Hat Inc. This file is part of Cygwin. @@ -10,6 +10,9 @@ details. */ #ifndef _CYGWIN_STDLIB_H #define _CYGWIN_STDLIB_H + +#include + #ifdef __cplusplus extern "C" { diff --git a/winsup/cygwin/include/cygwin/wait.h b/winsup/cygwin/include/cygwin/wait.h new file mode 100644 index 000000000..12a351326 --- /dev/null +++ b/winsup/cygwin/include/cygwin/wait.h @@ -0,0 +1,34 @@ +/* cygwin/wait.h + + Copyright 2006 Red Hat, Inc. + +This file is part of Cygwin. + +This software is a copyrighted work licensed under the terms of the +Cygwin license. Please consult the file "CYGWIN_LICENSE" for +details. */ + +#ifndef _CYGWIN_WAIT_H +#define _CYGWIN_WAIT_H + +#define WNOHANG 1 +#define WUNTRACED 2 + +/* A status looks like: + <2 bytes info> <2 bytes code> + + == 0, child has exited, info is the exit value + == 1..7e, child has exited, info is the signal number. + == 7f, child has stopped, info was the signal number. + == 80, there was a core dump. +*/ + +#define WIFEXITED(w) (((w) & 0xff) == 0) +#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) +#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f) +#define WEXITSTATUS(w) (((w) >> 8) & 0xff) +#define WTERMSIG(w) ((w) & 0x7f) +#define WSTOPSIG WEXITSTATUS +#define WCOREDUMP(w) (WIFSIGNALED(w) && (w & 0x80)) + +#endif /* _CYGWIN_WAIT_H */ diff --git a/winsup/cygwin/include/sys/wait.h b/winsup/cygwin/include/sys/wait.h index d0708383f..04bbae7f5 100644 --- a/winsup/cygwin/include/sys/wait.h +++ b/winsup/cygwin/include/sys/wait.h @@ -1,6 +1,6 @@ /* sys/wait.h - Copyright 1997, 1998, 2001, 2002, 2003, 2004 Red Hat, Inc. + Copyright 1997, 1998, 2001, 2002, 2003, 2004, 2006 Red Hat, Inc. This file is part of Cygwin. @@ -13,31 +13,12 @@ details. */ #include #include +#include #ifdef __cplusplus extern "C" { #endif -#define WNOHANG 1 -#define WUNTRACED 2 - -/* A status looks like: - <2 bytes info> <2 bytes code> - - == 0, child has exited, info is the exit value - == 1..7e, child has exited, info is the signal number. - == 7f, child has stopped, info was the signal number. - == 80, there was a core dump. -*/ - -#define WIFEXITED(w) (((w) & 0xff) == 0) -#define WIFSIGNALED(w) (((w) & 0x7f) > 0 && (((w) & 0x7f) < 0x7f)) -#define WIFSTOPPED(w) (((w) & 0xff) == 0x7f) -#define WEXITSTATUS(w) (((w) >> 8) & 0xff) -#define WTERMSIG(w) ((w) & 0x7f) -#define WSTOPSIG WEXITSTATUS -#define WCOREDUMP(w) (WIFSIGNALED(w) && (w & 0x80)) - pid_t wait (int *); pid_t waitpid (pid_t, int *, int); pid_t wait3 (int *__status, int __options, struct rusage *__rusage); -- cgit v1.2.3