posix.td
3.19 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
def POSIX : StandardSpec<"POSIX"> {
NamedType OffTType = NamedType<"off_t">;
HeaderSpec Errno = HeaderSpec<
"errno.h",
[
Macro<"E2BIG">,
Macro<"EACCES">,
Macro<"EADDRINUSE">,
Macro<"EADDRNOTAVAIL">,
Macro<"EAFNOSUPPORT">,
Macro<"EAGAIN">,
Macro<"EALREADY">,
Macro<"EBADF">,
Macro<"EBADMSG">,
Macro<"EBUSY">,
Macro<"ECANCELED">,
Macro<"ECHILD">,
Macro<"ECONNABORTED">,
Macro<"ECONNREFUSED">,
Macro<"ECONNRESET">,
Macro<"EDEADLK">,
Macro<"EDESTADDRREQ">,
Macro<"EDQUOT">,
Macro<"EEXIST">,
Macro<"EFAULT">,
Macro<"EFBIG">,
Macro<"EHOSTUNREACH">,
Macro<"EIDRM">,
Macro<"EINPROGRESS">,
Macro<"EINTR">,
Macro<"EINVAL">,
Macro<"EIO">,
Macro<"EISCONN">,
Macro<"EISDIR">,
Macro<"ELOOP">,
Macro<"EMFILE">,
Macro<"EMLINK">,
Macro<"EMSGSIZE">,
Macro<"EMULTIHOP">,
Macro<"ENAMETOOLONG">,
Macro<"ENETDOWN">,
Macro<"ENETRESET">,
Macro<"ENETUNREACH">,
Macro<"ENFILE">,
Macro<"ENOBUFS">,
Macro<"ENODATA">,
Macro<"ENODEV">,
Macro<"ENOENT">,
Macro<"ENOEXEC">,
Macro<"ENOLCK">,
Macro<"ENOLINK">,
Macro<"ENOMEM">,
Macro<"ENOMSG">,
Macro<"ENOPROTOOPT">,
Macro<"ENOSPC">,
Macro<"ENOSR">,
Macro<"ENOSTR">,
Macro<"ENOSYS">,
Macro<"ENOTCONN">,
Macro<"ENOTDIR">,
Macro<"ENOTEMPTY">,
Macro<"ENOTRECOVERABLE">,
Macro<"ENOTSOCK">,
Macro<"ENOTSUP">,
Macro<"ENOTTY">,
Macro<"ENXIO">,
Macro<"EOPNOTSUPP">,
Macro<"EOVERFLOW">,
Macro<"EOWNERDEAD">,
Macro<"EPERM">,
Macro<"EPIPE">,
Macro<"EPROTO">,
Macro<"EPROTONOSUPPORT">,
Macro<"EPROTOTYPE">,
Macro<"EROFS">,
Macro<"ESPIPE">,
Macro<"ESRCH">,
Macro<"ESTALE">,
Macro<"ETIME">,
Macro<"ETIMEDOUT">,
Macro<"ETXTBSY">,
Macro<"EWOULDBLOCK">,
Macro<"EXDEV">,
],
[], // Types
[] // Functions
>;
HeaderSpec SysMMan = HeaderSpec<
"sys/mman.h",
[
// TODO: Add a facility to bunch macros into bitwise-or-able groups.
// POSIX requires it, so such thing should be captured in this spec.
Macro<"PROT_EXEC">,
Macro<"PROT_NONE">,
Macro<"PROT_READ">,
Macro<"PROT_WRITE">,
Macro<"MAP_FIXED">,
Macro<"MAP_PRIVATE">,
Macro<"MAP_SHARED">,
Macro<"MAP_FAILED">,
],
[
SizeTType,
OffTType,
],
[
FunctionSpec<
"mmap",
RetValSpec<VoidPtr>,
[ArgSpec<VoidPtr>,
ArgSpec<SizeTType>,
ArgSpec<IntType>,
ArgSpec<IntType>,
ArgSpec<IntType>,
ArgSpec<OffTType>]
>,
FunctionSpec<
"munmap",
RetValSpec<IntType>,
[ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
>,
]
>;
let Headers = [
Errno,
SysMMan,
];
}