SysV IPC headers
[reactos.git] / posix / include / sys / wait.h
1 /* $Id: wait.h,v 1.3 2002/05/17 01:37:15 hyperion Exp $
2 */
3 /*
4 * sys/wait.h
5 *
6 * declarations for waiting. Conforming to the Single UNIX(r) Specification
7 * Version 2, System Interface & Headers Issue 5
8 *
9 * This file is part of the ReactOS Operating System.
10 *
11 * Contributors:
12 * Created by KJK::Hyperion <noog@libero.it>
13 *
14 * THIS SOFTWARE IS NOT COPYRIGHTED
15 *
16 * This source code is offered for use in the public domain. You may
17 * use, modify or distribute it freely.
18 *
19 * This code is distributed in the hope that it will be useful but
20 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
21 * DISCLAMED. This includes but is not limited to warranties of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
23 *
24 */
25 #ifndef __SYS_WAIT_H_INCLUDED__
26 #define __SYS_WAIT_H_INCLUDED__
27
28 /* INCLUDES */
29 #include <signal.h>
30 #include <sys/resource.h>
31
32 /* OBJECTS */
33
34 /* TYPES */
35 typedef enum __tagidtype_t
36 {
37 P_ALL,
38 P_PID,
39 P_PGID
40 } idtype_t;
41
42 /* CONSTANTS */
43 /* Possible values for the options argument to waitid() */
44 #define WEXITED (0x00000001) /* Wait for processes that have exited */
45 #define WSTOPPED (0x00000002) /* Status will be returned for any child that has stopped upon receipt of a signal */
46 #define WNOWAIT (0x00000004) /* Keep the process whose status is returned in infop in a waitable state */
47
48 #define WCONTINUED (0x00000008) /* Status will be returned for any child that was stopped and has been continued */
49 #define WNOHANG (0x00000010) /* Return immediately if there are no children to wait for */
50 #define WUNTRACED (0x00000020) /* Report status of stopped child process */
51
52 /* PROTOTYPES */
53 pid_t wait(int *);
54 pid_t wait3(int *, int, struct rusage *);
55 int waitid(idtype_t, id_t, siginfo_t *, int);
56 pid_t waitpid(pid_t, int *, int);
57
58 /* MACROS */
59 /* Macros for analysis of process status values */
60 #define WEXITSTATUS(__STATUS__) (1) /* Return exit status */
61 #define WIFCONTINUED(__STATUS__) (1) /* True if child has been continued */
62 #define WIFEXITED(__STATUS__) (1) /* True if child exited normally */
63 #define WIFSIGNALED(__STATUS__) (1) /* True if child exited due to uncaught signal */
64 #define WIFSTOPPED(__STATUS__) (1) /* True if child is currently stopped */
65 #define WSTOPSIG(__STATUS__) (1) /* Return signal number that caused process to stop */
66 #define WTERMSIG(__STATUS__) (1) /* Return signal number that caused process to terminate */
67
68 #endif /* __SYS_WAIT_H_INCLUDED__ */
69
70 /* EOF */
71