]> git.sur5r.net Git - openldap/blob - include/ac/wait.h
Add support for lber_types.h.nt and add a few NT specific feature macros.
[openldap] / include / ac / wait.h
1 /* Generic wait.h */
2 /*
3  * Copyright 1998,1999 The OpenLDAP Foundation, Redwood City, California, USA
4  * All rights reserved.
5  *
6  * Redistribution and use in source and binary forms are permitted only
7  * as authorized by the OpenLDAP Public License.  A copy of this
8  * license is available at http://www.OpenLDAP.org/license.html or
9  * in file LICENSE in the top-level directory of the distribution.
10  */
11
12 #ifndef _AC_WAIT_H
13 #define _AC_WAIT_H
14
15 #include <sys/types.h>
16
17 #if HAVE_SYS_WAIT_H
18 # include <sys/wait.h>
19 #endif
20
21 #define LDAP_HI(s)      (((s) >> 8) & 0377)
22 #define LDAP_LO(s)      ((s) & 0377)
23
24 /* These should work on non-POSIX UNIX platforms,
25         all bets on off on non-POSIX non-UNIX platforms... */
26 #ifndef WIFEXITED
27 # define WIFEXITED(s)   (LDAP_LO(s) == 0)
28 #endif
29 #ifndef WEXITSTATUS
30 # define WEXITSTATUS(s) LDAP_HI(s)
31 #endif
32 #ifndef WIFSIGNALED
33 # define WIFSIGNALED(s) (LDAP_LO(s) > 0 && LDAP_HI(s) == 0)
34 #endif
35 #ifndef WTERMSIG
36 # define WTERMSIG(s)    (LDAP_LO(s) & 0177)
37 #endif
38 #ifndef WIFSTOPPED
39 # define WIFSTOPPED(s)  (LDAP_LO(s) == 0177 && LDAP_HI(s) != 0)
40 #endif
41 #ifndef WSTOPSIG
42 # define WSTOPSIG(s)    LDAP_HI(s)
43 #endif
44
45 #ifdef WCONTINUED
46 # define WAIT_FLAGS ( WNOHANG | WUNTRACED | WCONTINUED )
47 #else
48 # define WAIT_FLAGS ( WNOHANG | WUNTRACED )
49 #endif
50
51 #endif /* _AC_WAIT_H */