Support to multi-threading and pthread interface (POSIX.1-2008) (#23)
[lunaix-os.git] / lunaix-os / includes / usr / lunaix / types.h
1 #ifndef __LUNAIX_SYS_TYPES_H
2 #define __LUNAIX_SYS_TYPES_H
3
4 #undef NULL
5 #define NULL (void*)0
6 #define NULLPTR 0
7
8 #define PEXITTERM 0x100
9 #define PEXITSTOP 0x200
10 #define PEXITSIG 0x400
11
12 #define PEXITNUM(flag, code) (flag | (code & 0xff))
13
14 #define WNOHANG 1
15 #define WUNTRACED 2
16 #define WEXITSTATUS(wstatus) ((wstatus & 0xff))
17 #define WIFSTOPPED(wstatus) ((wstatus & PEXITSTOP))
18 #define WIFEXITED(wstatus)                                                     \
19     ((wstatus & PEXITTERM) && ((char)WEXITSTATUS(wstatus) >= 0))
20
21 #define WIFSIGNALED(wstatus) ((wstatus & PEXITSIG))
22
23 typedef signed long ssize_t;
24
25 typedef int pid_t;
26 typedef int tid_t;
27
28 typedef __SIZE_TYPE__ size_t;
29
30 typedef __SIZE_TYPE__ off_t;
31
32 typedef unsigned int ino_t;
33
34 typedef struct dev_t
35 {
36     unsigned int meta;
37     unsigned int unique;
38     unsigned int index;
39 } dev_t;
40
41 #endif /* __LUNAIX_TYPES_H */