Define CLOCKS_PER_SEC type to the type clock_t
[platform/upstream/glibc.git] / bits / waitstatus.h
index 982c9db..9e698fe 100644 (file)
@@ -1,5 +1,5 @@
 /* Definitions of status bits for `wait' et al.
-   Copyright (C) 1992, 1994, 1996, 1997, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1992-2015 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -13,9 +13,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #if !defined _SYS_WAIT_H && !defined _STDLIB_H
 # error "Never include <bits/waitstatus.h> directly; use <sys/wait.h> instead."
 #define        __WIFEXITED(status)     (__WTERMSIG(status) == 0)
 
 /* Nonzero if STATUS indicates termination by a signal.  */
-#ifdef __GNUC__
-# define __WIFSIGNALED(status) \
-  (__extension__ ({ int __status = (status);                                 \
-                   !__WIFSTOPPED(__status) && !__WIFEXITED(__status); }))
-#else  /* Not GCC.  */
-# define __WIFSIGNALED(status) (!__WIFSTOPPED(status) && !__WIFEXITED(status))
-#endif /* GCC.  */
+#define __WIFSIGNALED(status) \
+  (((signed char) (((status) & 0x7f) + 1) >> 1) > 0)
 
 /* Nonzero if STATUS indicates the child is stopped.  */
 #define        __WIFSTOPPED(status)    (((status) & 0xff) == 0x7f)
 
+/* Nonzero if STATUS indicates the child continued after a stop.  We only
+   define this if <bits/waitflags.h> provides the WCONTINUED flag bit.  */
+#ifdef WCONTINUED
+# define __WIFCONTINUED(status)        ((status) == __W_CONTINUED)
+#endif
+
 /* Nonzero if STATUS indicates the child dumped core.  */
 #define        __WCOREDUMP(status)     ((status) & __WCOREFLAG)
 
 /* Macros for constructing status values.  */
 #define        __W_EXITCODE(ret, sig)  ((ret) << 8 | (sig))
 #define        __W_STOPCODE(sig)       ((sig) << 8 | 0x7f)
+#define __W_CONTINUED          0xffff
 #define        __WCOREFLAG             0x80
 
 
-#ifdef __USE_BSD
+#ifdef __USE_MISC
 
 # include <endian.h>
 
@@ -101,4 +102,4 @@ union wait
 # define w_stopsig     __wait_stopped.__w_stopsig
 # define w_stopval     __wait_stopped.__w_stopval
 
-#endif /* Use BSD.  */
+#endif /* Use misc.  */