File: wait.h

package info (click to toggle)
inn2 2.4.5-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,912 kB
  • ctags: 7,860
  • sloc: ansic: 85,104; perl: 11,427; sh: 9,863; makefile: 2,498; yacc: 1,563; python: 298; lex: 252; tcl: 7
file content (41 lines) | stat: -rw-r--r-- 1,178 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/*  $Id: wait.h 5398 2002-04-09 07:21:58Z rra $
**
**  Portability wrapper around <sys/wait.h>.
**
**  This header includes <sys/wait.h> if it's available, and then makes sure
**  that the standard wait macros are defined and defines them if they
**  aren't.
*/

#ifndef PORTABLE_WAIT_H
#define PORTABLE_WAIT_H 1

#include "config.h"

#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif

/* Per the autoconf documentation, just always check to see if the various
   macros are defined and define them ourselves if they aren't.  These
   definitions are based on the approach taken by BSDI. */
#ifndef WCOREDUMP
# define WCOREDUMP(status)      ((unsigned)(status) & 0x80)
#endif
#ifndef WEXITSTATUS
# define WEXITSTATUS(status)    (((unsigned)(status) >> 8) & 0xff)
#endif
#ifndef WTERMSIG
# define WTERMSIG(status)       ((unsigned)(status) & 0x7f)
#endif
#ifndef WIFEXITED
# define WIFEXITED(status)      (((unsigned)(status) & 0xff) == 0)
#endif
#ifndef WIFSTOPPED
# define WIFSTOPPED(status)     (((unsigned)(status) & 0xff) == 0x7f)
#endif
#ifndef WIFSIGNALED
# define WIFSIGNALED(status)    (!WIFSTOPPED(status) && !WIFEXITED(status))
#endif

#endif /* PORTABLE_WAIT_H */