MentOS  0.8.0
The Mentoring Operating System
wait.h
Go to the documentation of this file.
1 
6 #pragma once
7 
9 #define WNOHANG 0x00000001
10 
13 #define WUNTRACED 0x00000002
14 
17 #define WIFSIGNALED(status) (!WIFSTOPPED(status) && !WIFEXITED(status))
18 
22 #define WIFSTOPPED(status) (((status)&0xff) == 0x7f)
23 
29 #define WEXITSTATUS(status) (((status)&0xff00) >> 8)
30 
34 #define WTERMSIG(status) ((status)&0x7f)
35 
37 #define WIFEXITED(status) (WTERMSIG(status) == 0)
38 
41 #define WSTOPSIG(status) (WEXITSTATUS(status))
42 
43 //==== Task States ============================================================
44 #define TASK_RUNNING 0x00
45 #define TASK_INTERRUPTIBLE (1 << 0)
46 #define TASK_UNINTERRUPTIBLE (1 << 1)
47 #define TASK_STOPPED (1 << 2)
48 #define TASK_TRACED (1 << 3)
49 #define EXIT_ZOMBIE (1 << 4)
50 #define EXIT_DEAD (1 << 5)
51 //==============================================================================
52 
58 extern pid_t wait(int *status);
59 
76 extern pid_t waitpid(pid_t pid, int *status, int options);
pid_t waitpid(pid_t pid, int *status, int options)
Suspends the execution of the calling thread until a child specified by pid argument has changed stat...
Definition: waitpid.c:15
pid_t wait(int *status)
Suspends the execution of the calling thread until ANY child has changed state.
Definition: waitpid.c:35
signed int pid_t
The type of process id.
Definition: types.h:9