[libc][NFC] Move aligned access implementations to separate header
[llvm-project.git] / libc / spec / posix.td
blob54c6eb5f4c2420c43b43f8e3a0a6dbe46d2b3889
1 def SigSetType : NamedType<"sigset_t">;
2 def SigSetPtrType : PtrType<SigSetType>;
3 def ConstSigSetPtrType : ConstType<SigSetPtrType>;
4 def RestrictedSigSetType : RestrictedPtrType<SigSetType>;
5 def ConstRestrictedSigSetType : ConstType<RestrictedSigSetType>;
7 def SigInfoType : NamedType<"siginfo_t">;
8 def UnionSigVal : NamedType<"union sigval">;
10 def StructSigaction : NamedType<"struct sigaction">;
11 def StructSigactionPtr : PtrType<StructSigaction>;
12 def ConstStructSigactionPtr : ConstType<StructSigactionPtr>;
13 def RestrictedStructSigactionPtr : RestrictedPtrType<StructSigaction>;
14 def ConstRestrictedStructSigactionPtr : ConstType<RestrictedStructSigactionPtr>;
16 def PThreadStartT : NamedType<"__pthread_start_t">;
17 def PThreadTSSDtorT : NamedType<"__pthread_tss_dtor_t">;
18 def PThreadKeyT : NamedType<"pthread_key_t">;
19 def PThreadKeyTPtr : PtrType<PThreadKeyT>;
20 def PThreadOnceT : NamedType<"pthread_once_t">;
21 def PThreadOnceTPtr : PtrType<PThreadOnceT>;
22 def PThreadOnceCallback : NamedType<"__pthread_once_func_t">;
24 def InoT : NamedType<"ino_t">;
25 def UidT : NamedType<"uid_t">;
26 def GidT : NamedType<"gid_t">;
27 def DevT : NamedType<"dev_t">;
28 def ClockIdT : NamedType<"clockid_t">;
29 def BlkSizeT : NamedType<"blksize_t">;
30 def BlkCntT : NamedType<"blkcnt_t">;
31 def NLinkT : NamedType<"nlink_t">;
33 def StatType : NamedType<"struct stat">;
34 def StatTypePtr : PtrType<StatType>;
35 def RestrictedStatTypePtr : RestrictedPtrType<StatType>;
37 def DIR : NamedType<"DIR">;
38 def DIRPtr : PtrType<DIR>;
39 def DIRRestrictedPtr : RestrictedPtrType<DIR>;
40 def StructDirent : NamedType<"struct dirent">;
41 def StructDirentPtr : PtrType<StructDirent>;
42 def StructDirentPtrPtr : PtrType<StructDirentPtr>;
43 def ConstStructDirentPtrPtr : ConstType<StructDirentPtrPtr>;
45 def StructTimeSpec : NamedType<"struct timespec">;
46 def StructTimeSpecPtr : PtrType<StructTimeSpec>;
48 def StructSchedParam : NamedType<"struct sched_param">;
49 def StructSchedParamPtr : PtrType<StructSchedParam>;
50 def ConstStructSchedParamPtr : ConstType<StructSchedParamPtr>;
52 def ExecArgvT : NamedType<"__exec_argv_t">;
53 def ExecEnvpT : NamedType<"__exec_envp_t">;
55 def AtForkCallbackT : NamedType<"__atfork_callback_t">;
57 def PosixSpawnFileActionsT : NamedType<"posix_spawn_file_actions_t">;
58 def PosixSpawnFileActionsTPtr : PtrType<PosixSpawnFileActionsT>;
59 def ConstPosixSpawnFileActionsTPtr : ConstType<PosixSpawnFileActionsTPtr>;
60 def PosixSpawnFileActionsTRestrictedPtr : RestrictedPtrType<PosixSpawnFileActionsT>;
62 def PosixSpawnAttrT : NamedType<"posix_spawnattr_t">;
63 def RestrictedPosixSpawnAttrTPtrType : RestrictedPtrType<PosixSpawnAttrT>;
65 def CcT : NamedType<"cc_t">;
66 def SpeedT : NamedType<"speed_t">;
67 def StructTermios : NamedType<"struct termios">;
68 def StructTermiosPtr : PtrType<StructTermios>;
69 def ConstStructTermiosPtr : ConstType<StructTermiosPtr>;
70 def TcFlagT : NamedType<"tcflag_t">;
72 def StackT : NamedType<"stack_t">;
73 def StackTPtr : PtrType<StackT>;
74 def RestrictedStackTPtr : RestrictedPtrType<StackT>;
75 def ConstRestrictedStackTPtr : ConstType<RestrictedStackTPtr>;
77 def FdSet : NamedType<"fd_set">;
78 def FdSetPtr : PtrType<FdSet>;
79 def RestrictedFdSetPtr : RestrictedPtrType<FdSet>;
81 def GetoptArgvT : NamedType<"__getoptargv_t">;
83 def StructSockAddr : NamedType<"struct sockaddr">;
84 def StructSockAddrPtr : PtrType<StructSockAddr>;
85 def SAFamilyType : NamedType<"sa_family_t">;
87 def POSIX : StandardSpec<"POSIX"> {
88   PtrType CharPtr = PtrType<CharType>;
89   RestrictedPtrType RestrictedCharPtr = RestrictedPtrType<CharType>;
90   RestrictedPtrType CharRestrictedDoublePtr = RestrictedPtrType<CharPtr>;
91   ConstType ConstCharPtr = ConstType<CharPtr>;
92   ConstType ConstRestrictedCharPtr = ConstType<RestrictedCharPtr>;
94   NamedType ModeTType = NamedType<"mode_t">;
96   NamedType PThreadAttrTType = NamedType<"pthread_attr_t">;
97   PtrType PThreadAttrTPtr = PtrType<PThreadAttrTType>;
98   RestrictedPtrType RestrictedPThreadAttrTPtr = RestrictedPtrType<PThreadAttrTType>;
99   ConstType ConstPThreadAttrTPtr = ConstType<PThreadAttrTPtr>;
100   ConstType ConstRestrictedPThreadAttrTPtr = ConstType<RestrictedPThreadAttrTPtr>;
102   NamedType PThreadMutexAttrTType = NamedType<"pthread_mutexattr_t">;
103   PtrType PThreadMutexAttrTPtr = PtrType<PThreadMutexAttrTType>;
104   RestrictedPtrType RestrictedPThreadMutexAttrTPtr = RestrictedPtrType<PThreadMutexAttrTType>;
105   ConstType ConstPThreadMutexAttrTPtr = ConstType<PThreadMutexAttrTPtr>;
106   ConstType ConstRestrictedPThreadMutexAttrTPtr = ConstType<RestrictedPThreadMutexAttrTPtr>;
108   NamedType PThreadMutexTType = NamedType<"pthread_mutex_t">;
109   PtrType PThreadMutexTPtr = PtrType<PThreadMutexTType>;
110   RestrictedPtrType RestrictedPThreadMutexTPtr = RestrictedPtrType<PThreadMutexTType>;
111   ConstType ConstPThreadMutexTPtr = ConstType<PThreadMutexTPtr>;
112   ConstType ConstRestrictedPThreadMutexTPtr = ConstType<RestrictedPThreadMutexTPtr>;
114   PtrType PThreadTPtr = PtrType<PThreadTType>;
115   RestrictedPtrType RestrictedPThreadTPtr = RestrictedPtrType<PThreadTType>;
117   HeaderSpec Errno = HeaderSpec<
118       "errno.h",
119       [
120         Macro<"E2BIG">,
121         Macro<"EACCES">,
122         Macro<"EADDRINUSE">,
123         Macro<"EADDRNOTAVAIL">,
124         Macro<"EAFNOSUPPORT">,
125         Macro<"EAGAIN">,
126         Macro<"EALREADY">,
127         Macro<"EBADF">,
128         Macro<"EBADMSG">,
129         Macro<"EBUSY">,
130         Macro<"ECANCELED">,
131         Macro<"ECHILD">,
132         Macro<"ECONNABORTED">,
133         Macro<"ECONNREFUSED">,
134         Macro<"ECONNRESET">,
135         Macro<"EDEADLK">,
136         Macro<"EDESTADDRREQ">,
137         Macro<"EDQUOT">,
138         Macro<"EEXIST">,
139         Macro<"EFAULT">,
140         Macro<"EFBIG">,
141         Macro<"EHOSTUNREACH">,
142         Macro<"EIDRM">,
143         Macro<"EINPROGRESS">,
144         Macro<"EINTR">,
145         Macro<"EINVAL">,
146         Macro<"EIO">,
147         Macro<"EISCONN">,
148         Macro<"EISDIR">,
149         Macro<"ELOOP">,
150         Macro<"EMFILE">,
151         Macro<"EMLINK">,
152         Macro<"EMSGSIZE">,
153         Macro<"EMULTIHOP">,
154         Macro<"ENAMETOOLONG">,
155         Macro<"ENETDOWN">,
156         Macro<"ENETRESET">,
157         Macro<"ENETUNREACH">,
158         Macro<"ENFILE">,
159         Macro<"ENOBUFS">,
160         Macro<"ENODATA">,
161         Macro<"ENODEV">,
162         Macro<"ENOENT">,
163         Macro<"ENOEXEC">,
164         Macro<"ENOLCK">,
165         Macro<"ENOLINK">,
166         Macro<"ENOMEM">,
167         Macro<"ENOMSG">,
168         Macro<"ENOPROTOOPT">,
169         Macro<"ENOSPC">,
170         Macro<"ENOSR">,
171         Macro<"ENOSTR">,
172         Macro<"ENOSYS">,
173         Macro<"ENOTCONN">,
174         Macro<"ENOTDIR">,
175         Macro<"ENOTEMPTY">,
176         Macro<"ENOTRECOVERABLE">,
177         Macro<"ENOTSOCK">,
178         Macro<"ENOTSUP">,
179         Macro<"ENOTTY">,
180         Macro<"ENXIO">,
181         Macro<"EOPNOTSUPP">,
182         Macro<"EOVERFLOW">,
183         Macro<"EOWNERDEAD">,
184         Macro<"EPERM">,
185         Macro<"EPIPE">,
186         Macro<"EPROTO">,
187         Macro<"EPROTONOSUPPORT">,
188         Macro<"EPROTOTYPE">,
189         Macro<"EROFS">,
190         Macro<"ESPIPE">,
191         Macro<"ESRCH">,
192         Macro<"ESTALE">,
193         Macro<"ETIME">,
194         Macro<"ETIMEDOUT">,
195         Macro<"ETXTBSY">,
196         Macro<"EWOULDBLOCK">,
197         Macro<"EXDEV">,
198       ],
199       [], // Types
200       [], // Enumerations
201       []  // Functions
202   >;
204   HeaderSpec FCntl = HeaderSpec<
205     "fcntl.h",
206     [], // Macros
207     [ModeTType],
208     [], // Enumerations
209     [
210       FunctionSpec<
211           "creat",
212           RetValSpec<IntType>,
213           [ArgSpec<ConstCharPtr>, ArgSpec<ModeTType>]
214       >,
215       FunctionSpec<
216           "open",
217           RetValSpec<IntType>,
218           [ArgSpec<ConstCharPtr>, ArgSpec<IntType>, ArgSpec<VarArgType>]
219       >,
220       FunctionSpec<
221           "openat",
222           RetValSpec<IntType>,
223           [ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>, ArgSpec<VarArgType>]
224       >,
225     ]
226   >;
228   HeaderSpec SysMMan = HeaderSpec<
229       "sys/mman.h",
230       [
231         // TODO: Add a facility to bunch macros into bitwise-or-able groups.
232         // POSIX requires it, so such thing should be captured in this spec.
233         Macro<"PROT_EXEC">,
234         Macro<"PROT_NONE">,
235         Macro<"PROT_READ">,
236         Macro<"PROT_WRITE">,
238         Macro<"MAP_FIXED">,
239         Macro<"MAP_PRIVATE">,
240         Macro<"MAP_SHARED">,
242         Macro<"MAP_FAILED">,
243       ],
244       [
245         SizeTType,
246         OffTType,
247       ],
248       [], // Enumerations
249       [
250         FunctionSpec<
251             "madvise",
252             RetValSpec<IntType>,
253             [ArgSpec<VoidPtr>,
254              ArgSpec<SizeTType>,
255              ArgSpec<IntType>]
256         >,
257         FunctionSpec<
258             "mmap",
259             RetValSpec<VoidPtr>,
260             [ArgSpec<VoidPtr>,
261              ArgSpec<SizeTType>,
262              ArgSpec<IntType>,
263              ArgSpec<IntType>,
264              ArgSpec<IntType>,
265              ArgSpec<OffTType>]
266         >,
267         FunctionSpec<
268             "mprotect",
269             RetValSpec<IntType>,
270             [ArgSpec<VoidPtr>,
271              ArgSpec<SizeTType>,
272              ArgSpec<IntType>]
273         >,
274         FunctionSpec<
275             "munmap",
276             RetValSpec<IntType>,
277             [ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
278         >,
279         FunctionSpec<
280             "posix_madvise",
281             RetValSpec<IntType>,
282             [ArgSpec<VoidPtr>,
283              ArgSpec<SizeTType>,
284              ArgSpec<IntType>]
285         >,
286       ]
287   >;
289   HeaderSpec Signal = HeaderSpec<
290       "signal.h",
291       [], // Macros
292       [
293         SigInfoType,
294         SigSetType,
295         StackT,
296         StructSigaction,
297         UnionSigVal,
298         PidT,
299       ],
300       [], // Enumerations
301       [
302         FunctionSpec<
303           "kill",
304           RetValSpec<IntType>,
305           [ArgSpec<PidT>,
306             ArgSpec<IntType>]
307         >,
308         FunctionSpec<
309           "sigaction",
310           RetValSpec<IntType>,
311           [ArgSpec<IntType>,
312            ArgSpec<ConstRestrictedStructSigactionPtr>,
313            ArgSpec<RestrictedStructSigactionPtr>]
314         >,
315         FunctionSpec<
316           "sigaltstack",
317           RetValSpec<IntType>,
318           [ArgSpec<ConstRestrictedStackTPtr>, ArgSpec<RestrictedStackTPtr>]
319         >,
320         FunctionSpec<
321           "sigdelset",
322           RetValSpec<IntType>,
323           [ArgSpec<SigSetPtrType>,
324            ArgSpec<IntType>]
325         >,
326         FunctionSpec<
327           "sigprocmask",
328           RetValSpec<IntType>,
329           [ArgSpec<IntType>, ArgSpec<ConstRestrictedSigSetType>, ArgSpec<RestrictedSigSetType>]
330         >,
331         FunctionSpec<
332           "sigemptyset",
333           RetValSpec<IntType>,
334           [ArgSpec<SigSetPtrType>]
335         >,
336         FunctionSpec<
337           "sigaddset",
338           RetValSpec<IntType>,
339           [ArgSpec<SigSetPtrType>,
340            ArgSpec<IntType>]
341         >,
342         FunctionSpec<
343           "sigfillset",
344           RetValSpec<IntType>,
345           [ArgSpec<SigSetPtrType>]
346         >,
347       ]
348   >;
350   HeaderSpec UniStd = HeaderSpec<
351     "unistd.h",
352     [], // Macros
353     [
354       ExecArgvT,
355       ExecEnvpT,
356       OffTType,
357       SSizeTType,
358       SizeTType,
359       PidT,
360       UidT,
361       GetoptArgvT,
362     ],
363     [], // Enumerations
364     [
365         FunctionSpec<
366           "access",
367           RetValSpec<IntType>,
368           [ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
369         >,
370         FunctionSpec<
371           "chdir",
372           RetValSpec<IntType>,
373           [ArgSpec<ConstCharPtr>]
374         >,
375         FunctionSpec<
376           "dup",
377           RetValSpec<IntType>,
378           [ArgSpec<IntType>]
379         >,
380         FunctionSpec<
381           "dup2",
382           RetValSpec<IntType>,
383           [ArgSpec<IntType>, ArgSpec<IntType>]
384         >,
385         FunctionSpec<
386           "dup3",
387           RetValSpec<IntType>,
388           [ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<IntType>]
389         >,
390         FunctionSpec<
391           "fchdir",
392           RetValSpec<IntType>,
393           [ArgSpec<IntType>]
394         >,
395         FunctionSpec<
396           "getcwd",
397           RetValSpec<CharPtr>,
398           [ArgSpec<CharPtr>, ArgSpec<SizeTType>]
399         >,
400         FunctionSpec<
401           "close",
402           RetValSpec<IntType>,
403           [ArgSpec<IntType>]
404         >,
405         FunctionSpec<
406           "execv",
407           RetValSpec<IntType>,
408           [ArgSpec<ConstCharPtr>, ArgSpec<ExecArgvT>]
409         >,
410         FunctionSpec<
411           "execve",
412           RetValSpec<IntType>,
413           [ArgSpec<ConstCharPtr>, ArgSpec<ExecArgvT>, ArgSpec<ExecEnvpT>]
414         >,
415         FunctionSpec<
416           "fork",
417           RetValSpec<PidT>,
418           [ArgSpec<VoidType>]
419         >,
420         FunctionSpec<
421           "fsync",
422           RetValSpec<IntType>,
423           [ArgSpec<IntType>]
424         >,
425         FunctionSpec<
426           "ftruncate",
427           RetValSpec<IntType>,
428           [ArgSpec<IntType>, ArgSpec<OffTType>]
429         >,
430         FunctionSpec<
431           "geteuid",
432           RetValSpec<UidT>,
433           [ArgSpec<VoidType>]
434         >,
435         FunctionSpec<
436           "getpid",
437           RetValSpec<PidT>,
438           [ArgSpec<VoidType>]
439         >,
440         FunctionSpec<
441           "getppid",
442           RetValSpec<PidT>,
443           [ArgSpec<VoidType>]
444         >,
445         FunctionSpec<
446           "getuid",
447           RetValSpec<UidT>,
448           [ArgSpec<VoidType>]
449         >,
450         FunctionSpec<
451           "isatty",
452           RetValSpec<IntType>,
453           [ArgSpec<IntType>]
454         >,
455         FunctionSpec<
456           "link",
457           RetValSpec<IntType>,
458           [ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
459         >,
460         FunctionSpec<
461           "linkat",
462           RetValSpec<IntType>,
463           [ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
464         >,
465         FunctionSpec<
466           "lseek",
467           RetValSpec<OffTType>,
468           [ArgSpec<IntType>, ArgSpec<OffTType>, ArgSpec<IntType>]
469         >,
470         FunctionSpec<
471           "pread",
472           RetValSpec<SSizeTType>,
473           [ArgSpec<IntType>, ArgSpec<VoidPtr>, ArgSpec<SizeTType>, ArgSpec<OffTType>]
474         >,
475         FunctionSpec<
476           "pwrite",
477           RetValSpec<SSizeTType>,
478           [ArgSpec<IntType>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>, ArgSpec<OffTType>]
479         >,
480         FunctionSpec<
481           "read",
482           RetValSpec<SSizeTType>,
483           [ArgSpec<IntType>, ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
484         >,
485         FunctionSpec<
486           "readlink",
487           RetValSpec<SSizeTType>,
488           [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtr>, ArgSpec<SizeTType>]
489         >,
490         FunctionSpec<
491           "readlinkat",
492           RetValSpec<SSizeTType>,
493           [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtr>, ArgSpec<SizeTType>]
494         >,
495         FunctionSpec<
496           "rmdir",
497           RetValSpec<IntType>,
498           [ArgSpec<ConstCharPtr>]
499         >,
500         FunctionSpec<
501           "getpid",
502           RetValSpec<IntType>,
503           [ArgSpec<VoidType>]
504         >,
505         FunctionSpec<
506           "getppid",
507           RetValSpec<IntType>,
508           [ArgSpec<VoidType>]
509         >,
510         FunctionSpec<
511           "link",
512           RetValSpec<IntType>,
513           [ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
514         >,
515         FunctionSpec<
516           "linkat",
517           RetValSpec<IntType>,
518           [ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
519         >,
520         FunctionSpec<
521           "lseek",
522           RetValSpec<OffTType>,
523           [ArgSpec<IntType>, ArgSpec<OffTType>, ArgSpec<IntType>]
524         >,
525         FunctionSpec<
526           "pread",
527           RetValSpec<SSizeTType>,
528           [ArgSpec<IntType>, ArgSpec<VoidPtr>, ArgSpec<SizeTType>, ArgSpec<OffTType>]
529         >,
530         FunctionSpec<
531           "pwrite",
532           RetValSpec<SSizeTType>,
533           [ArgSpec<IntType>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>, ArgSpec<OffTType>]
534         >,
535         FunctionSpec<
536           "read",
537           RetValSpec<SSizeTType>,
538           [ArgSpec<IntType>, ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
539         >,
540         FunctionSpec<
541           "readlink",
542           RetValSpec<SSizeTType>,
543           [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtr>, ArgSpec<SizeTType>]
544         >,
545         FunctionSpec<
546           "readlinkat",
547           RetValSpec<SSizeTType>,
548           [ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtr>, ArgSpec<SizeTType>]
549         >,
550         FunctionSpec<
551           "rmdir",
552           RetValSpec<IntType>,
553           [ArgSpec<ConstCharPtr>]
554         >,
555         FunctionSpec<
556           "swab",
557           RetValSpec<VoidType>,
558           [ArgSpec<ConstVoidRestrictedPtr>, ArgSpec<VoidPtr>, ArgSpec<SSizeTType>]
559         >,
560         FunctionSpec<
561           "symlink",
562           RetValSpec<IntType>,
563           [ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
564         >,
565         FunctionSpec<
566           "symlinkat",
567           RetValSpec<IntType>,
568           [ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>, ArgSpec<ConstCharPtr>]
569         >,
570         FunctionSpec<
571           "sysconf",
572           RetValSpec<IntType>,
573           [ArgSpec<IntType>]
574         >,
575         FunctionSpec<
576           "__llvm_libc_syscall",
577           RetValSpec<LongType>,
578           [ArgSpec<LongType>,ArgSpec<LongType>,ArgSpec<LongType>,ArgSpec<LongType>,ArgSpec<LongType>,ArgSpec<LongType>,ArgSpec<LongType>]
579         >,
580         FunctionSpec<
581           "truncate",
582           RetValSpec<IntType>,
583           [ArgSpec<ConstCharPtr>, ArgSpec<OffTType>]
584         >,
585         FunctionSpec<
586           "unlink",
587           RetValSpec<IntType>,
588           [ArgSpec<ConstCharPtr>]
589         >,
590         FunctionSpec<
591           "unlinkat",
592           RetValSpec<IntType>,
593           [ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
594         >,
595         FunctionSpec<
596           "write",
597           RetValSpec<SSizeTType>,
598           [ArgSpec<IntType>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>]
599         >,
600         FunctionSpec<
601           "getopt",
602           RetValSpec<IntType>,
603           [ArgSpec<IntType>, ArgSpec<GetoptArgvT>, ArgSpec<ConstCharPtr>]
604         >,
605     ],
606     [
607         ObjectSpec<"environ", "char **">,
608         ObjectSpec<
609           "optarg",
610           "char *"
611         >,
612         ObjectSpec<
613           "optind",
614           "int"
615         >,
616         ObjectSpec<
617           "opterr",
618           "int"
619         >,
620         ObjectSpec<
621           "optopt",
622           "int"
623         >,
624     ]
625   >;
627   HeaderSpec StdLib = HeaderSpec<
628     "stdlib.h",
629     [], // Macros
630     [], // Types
631     [], // Enumerations
632     [
633         FunctionSpec<
634           "getenv",
635           RetValSpec<CharPtr>,
636           [ArgSpec<ConstCharPtr>]
637         >,
638     ]
639   >;
641   HeaderSpec Sched = HeaderSpec<
642       "sched.h",
643       [], // Macros
644       [PidT, TimeTType, StructTimeSpec, StructSchedParam], // Types
645       [], // Enumerations
646       [
647         FunctionSpec<
648             "sched_yield",
649             RetValSpec<IntType>,
650             [ArgSpec<VoidType>]
651         >,
652         FunctionSpec<
653             "sched_setparam",
654             RetValSpec<IntType>,
655             [ArgSpec<PidT>, ArgSpec<ConstStructSchedParamPtr>]
656         >,
658         FunctionSpec<
659             "sched_getparam",
660             RetValSpec<IntType>,
661             [ArgSpec<PidT>, ArgSpec<StructSchedParamPtr>]
662         >,
664         FunctionSpec<
665             "sched_setscheduler",
666             RetValSpec<IntType>,
667             [ArgSpec<PidT>]
668         >,
670         FunctionSpec<
671             "sched_getscheduler",
672             RetValSpec<IntType>,
673             [ArgSpec<PidT>, ArgSpec<IntType>, ArgSpec<ConstStructSchedParamPtr>]
674         >,
676         FunctionSpec<
677             "sched_get_priority_min",
678             RetValSpec<IntType>,
679             [ArgSpec<IntType>]
680         >,
682         FunctionSpec<
683             "sched_get_priority_max",
684             RetValSpec<IntType>,
685             [ArgSpec<IntType>]
686         >,
688         FunctionSpec<
689             "sched_rr_get_interval",
690             RetValSpec<IntType>,
691             [ArgSpec<PidT>, ArgSpec<StructTimeSpecPtr>]
692         >,
693       ]
694   >;
696   HeaderSpec String = HeaderSpec<
697     "string.h",
698     [
699         Macro<"NULL">,
700     ],
701     [
702         SizeTType,
703     ],
704     [], // Enumerations
705     [
706         FunctionSpec<
707             "memccpy",
708             RetValSpec<VoidPtr>,
709             [ArgSpec<VoidRestrictedPtr>,
710              ArgSpec<ConstVoidRestrictedPtr>,
711              ArgSpec<IntType>,
712              ArgSpec<SizeTType>]
713         >,
714         FunctionSpec<
715             "mempcpy",
716             RetValSpec<VoidPtr>,
717             [ArgSpec<VoidRestrictedPtr>,
718              ArgSpec<ConstVoidRestrictedPtr>,
719              ArgSpec<SizeTType>]
720         >,
721         FunctionSpec<
722             "stpcpy",
723             RetValSpec<CharPtr>,
724             [ArgSpec<RestrictedCharPtr>,
725              ArgSpec<ConstRestrictedCharPtr>]
726         >,
727         FunctionSpec<
728             "stpncpy",
729             RetValSpec<CharPtr>,
730             [ArgSpec<RestrictedCharPtr>,
731              ArgSpec<ConstRestrictedCharPtr>,
732              ArgSpec<SizeTType>]
733         >,
734         FunctionSpec<
735             "strnlen",
736              RetValSpec<SizeTType>,
737              [ArgSpec<ConstCharPtr>, ArgSpec<SizeTType>]
738         >,
739         FunctionSpec<
740             "strtok_r",
741             RetValSpec<CharPtr>,
742             [ArgSpec<RestrictedCharPtr>,
743              ArgSpec<ConstRestrictedCharPtr>,
744              ArgSpec<CharRestrictedDoublePtr>]
745         >,
746         FunctionSpec<
747             "strsignal",
748             RetValSpec<CharPtr>,
749             [ArgSpec<IntType>]
750         >,
751     ]
752   >;
754   HeaderSpec CType = HeaderSpec<
755     "ctype.h",
756     [], // Macros
757     [], // Types
758     [], // Enumerations
759     [
760         FunctionSpec<
761             "isascii",
762             RetValSpec<IntType>,
763             [ArgSpec<IntType>]
764         >,
765     ]
766   >;
768   NamedType RLimTType = NamedType<"rlim_t">;
769   NamedType StructRLimitType = NamedType<"struct rlimit">;
770   PtrType StructRLimitPtr = PtrType<StructRLimitType>;
771   ConstType ConstStructRLimitPtr = ConstType<StructRLimitType>;
772   HeaderSpec SysResource = HeaderSpec<
773     "sys/resource.h",
774     [], // Macros
775     [RLimTType, StructRLimitType], // Types
776     [], // Enumerations
777     [
778         FunctionSpec<
779           "getrlimit",
780           RetValSpec<IntType>,
781           [ArgSpec<StructRLimitPtr>]
782         >,
783         FunctionSpec<
784           "setrlimit",
785           RetValSpec<IntType>,
786           [ArgSpec<ConstStructRLimitPtr>]
787         >,
788     ]
789   >;
791   HeaderSpec SysStat = HeaderSpec<
792     "sys/stat.h",
793     [], // Macros
794     [
795         ModeTType,
796         DevT,
797         InoT,
798         UidT,
799         GidT,
800         StructTimeSpec,
801         StructTimevalType,
802         BlkSizeT,
803         BlkCntT,
804         OffTType,
805         NLinkT,
806         StatType,
807     ], // Types
808     [], // Enumerations
809     [
810         FunctionSpec<
811           "chmod",
812           RetValSpec<IntType>,
813           [ArgSpec<ConstCharPtr>, ArgSpec<ModeTType>]
814         >,
815         FunctionSpec<
816           "fchmod",
817           RetValSpec<IntType>,
818           [ArgSpec<IntType>, ArgSpec<ModeTType>]
819         >,
820         FunctionSpec<
821           "fchmodat",
822           RetValSpec<IntType>,
823           [ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<ModeTType>, ArgSpec<IntType>]
824         >,
825         FunctionSpec<
826             "fstat",
827             RetValSpec<IntType>,
828             [ArgSpec<IntType>, ArgSpec<StatTypePtr>]
829         >,
830         FunctionSpec<
831             "lstat",
832             RetValSpec<IntType>,
833             [ArgSpec<ConstRestrictedCharPtr>, ArgSpec<RestrictedStatTypePtr>]
834         >,
835         FunctionSpec<
836             "mkdir",
837             RetValSpec<IntType>,
838             [ArgSpec<ConstCharPtr>, ArgSpec<ModeTType>]
839         >,
840         FunctionSpec<
841             "mkdirat",
842             RetValSpec<IntType>,
843             [ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<ModeTType>]
844         >,
845         FunctionSpec<
846             "stat",
847             RetValSpec<IntType>,
848             [ArgSpec<ConstRestrictedCharPtr>, ArgSpec<RestrictedStatTypePtr>]
849         >,
850     ]
851   >;
853   NamedType StructUtsName = NamedType<"struct utsname">;
854   PtrType StructUtsNamePtr = PtrType<StructUtsName>;
855   HeaderSpec SysUtsName = HeaderSpec<
856     "sys/utsname.h",
857     [], // Macros
858     [StructUtsName], // Types
859     [], // Enumerations
860     [
861         FunctionSpec<
862             "uname",
863             RetValSpec<IntType>,
864             [ArgSpec<StructUtsNamePtr>]
865         >,
866     ]
867   >;
869   HeaderSpec ArpaInet = HeaderSpec<
870       "arpa/inet.h",
871       [], // Macros
872       [], // Types
873       [], // Enumerations
874       [
875           FunctionSpec<
876               "htonl",
877               RetValSpec<UInt32Type>,
878               [ArgSpec<UInt32Type>]
879           >,
880           FunctionSpec<
881               "htons",
882               RetValSpec<UInt16Type>,
883               [ArgSpec<UInt16Type>]
884           >,
885           FunctionSpec<
886               "ntohl",
887               RetValSpec<UInt32Type>,
888               [ArgSpec<UInt32Type>]
889           >,
890           FunctionSpec<
891               "ntohs",
892               RetValSpec<UInt16Type>,
893               [ArgSpec<UInt16Type>]
894           >,
895       ]
896   >;
898   HeaderSpec PThread = HeaderSpec<
899     "pthread.h",
900     [], // Macros
901     [
902         AtForkCallbackT,
903         PThreadAttrTType,
904         PThreadKeyT,
905         PThreadMutexAttrTType,
906         PThreadMutexTType,
907         PThreadOnceCallback,
908         PThreadOnceT,
909         PThreadStartT,
910         PThreadTSSDtorT,
911         PThreadTType,
912     ], // Types
913     [], // Enumerations
914     [
915       FunctionSpec<
916           "pthread_atfork",
917           RetValSpec<IntType>,
918           [ArgSpec<AtForkCallbackT>, ArgSpec<AtForkCallbackT>, ArgSpec<AtForkCallbackT>]
919       >,
920       FunctionSpec<
921           "pthread_attr_init",
922           RetValSpec<IntType>,
923           [ArgSpec<PThreadAttrTPtr>]
924       >,
925       FunctionSpec<
926           "pthread_attr_destroy",
927           RetValSpec<IntType>,
928           [ArgSpec<PThreadAttrTPtr>]
929       >,
930       FunctionSpec<
931           "pthread_attr_getdetachstate",
932           RetValSpec<IntType>,
933           [ArgSpec<ConstPThreadAttrTPtr>, ArgSpec<IntPtr>]
934       >,
935       FunctionSpec<
936           "pthread_attr_setdetachstate",
937           RetValSpec<IntType>,
938           [ArgSpec<PThreadAttrTPtr>, ArgSpec<IntType>]
939       >,
940       FunctionSpec<
941           "pthread_attr_getguardsize",
942           RetValSpec<IntType>,
943           [ArgSpec<ConstRestrictedPThreadAttrTPtr>, ArgSpec<RestrictedSizeTPtr>]
944       >,
945       FunctionSpec<
946           "pthread_attr_setguardsize",
947           RetValSpec<IntType>,
948           [ArgSpec<PThreadAttrTPtr>, ArgSpec<SizeTType>]
949       >,
950       FunctionSpec<
951           "pthread_attr_getstacksize",
952           RetValSpec<IntType>,
953           [ArgSpec<ConstRestrictedPThreadAttrTPtr>, ArgSpec<RestrictedSizeTPtr>]
954       >,
955       FunctionSpec<
956           "pthread_attr_setstacksize",
957           RetValSpec<IntType>,
958           [ArgSpec<PThreadAttrTPtr>, ArgSpec<SizeTType>]
959       >,
960       FunctionSpec<
961           "pthread_attr_getstack",
962           RetValSpec<IntType>,
963           [ArgSpec<ConstRestrictedPThreadAttrTPtr>, ArgSpec<RestrictedVoidPtrPtr>, ArgSpec<RestrictedSizeTPtr>]
964       >,
965       FunctionSpec<
966           "pthread_attr_setstack",
967           RetValSpec<IntType>,
968           [ArgSpec<PThreadAttrTPtr>, ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
969       >,
970       FunctionSpec<
971           "pthread_create",
972           RetValSpec<IntType>,
973           [ArgSpec<RestrictedPThreadTPtr>, ArgSpec<ConstRestrictedPThreadAttrTPtr>, ArgSpec<PThreadStartT>, ArgSpec<VoidPtr>]
974       >,
975       FunctionSpec<
976           "pthread_join",
977           RetValSpec<IntType>,
978           [ArgSpec<PThreadTType>, ArgSpec<VoidPtrPtr>]
979       >,
980       FunctionSpec<
981           "pthread_detach",
982           RetValSpec<IntType>,
983           [ArgSpec<PThreadTType>]
984       >,
985       FunctionSpec<
986           "pthread_exit",
987           RetValSpec<NoReturn>,
988           [ArgSpec<VoidPtr>]
989       >,
990       FunctionSpec<
991           "pthread_self",
992           RetValSpec<PThreadTType>,
993           [ArgSpec<VoidType>]
994       >,
995       FunctionSpec<
996           "pthread_equal",
997           RetValSpec<IntType>,
998           [ArgSpec<PThreadTType>, ArgSpec<PThreadTType>]
999       >,
1000       FunctionSpec<
1001           "pthread_mutexattr_init",
1002           RetValSpec<IntType>,
1003           [ArgSpec<PThreadMutexAttrTPtr>]
1004       >,
1005       FunctionSpec<
1006           "pthread_mutexattr_destroy",
1007           RetValSpec<IntType>,
1008           [ArgSpec<PThreadMutexAttrTPtr>]
1009       >,
1010       FunctionSpec<
1011           "pthread_mutexattr_gettype",
1012           RetValSpec<IntType>,
1013           [ArgSpec<ConstRestrictedPThreadMutexAttrTPtr>, ArgSpec<RestrictedIntPtr>]
1014       >,
1015       FunctionSpec<
1016           "pthread_mutexattr_settype",
1017           RetValSpec<IntType>,
1018           [ArgSpec<RestrictedPThreadMutexAttrTPtr>, ArgSpec<IntType>]
1019       >,
1020       FunctionSpec<
1021           "pthread_mutexattr_getrobust",
1022           RetValSpec<IntType>,
1023           [ArgSpec<ConstRestrictedPThreadMutexAttrTPtr>, ArgSpec<RestrictedIntPtr>]
1024       >,
1025       FunctionSpec<
1026           "pthread_mutexattr_setrobust",
1027           RetValSpec<IntType>,
1028           [ArgSpec<RestrictedPThreadMutexAttrTPtr>, ArgSpec<IntType>]
1029       >,
1030       FunctionSpec<
1031           "pthread_mutexattr_getpshared",
1032           RetValSpec<IntType>,
1033           [ArgSpec<ConstRestrictedPThreadMutexAttrTPtr>, ArgSpec<RestrictedIntPtr>]
1034       >,
1035       FunctionSpec<
1036           "pthread_mutexattr_setpshared",
1037           RetValSpec<IntType>,
1038           [ArgSpec<RestrictedPThreadMutexAttrTPtr>, ArgSpec<IntType>]
1039       >,
1040       FunctionSpec<
1041           "pthread_mutexattr_getprotocol",
1042           RetValSpec<IntType>,
1043           [ArgSpec<ConstRestrictedPThreadMutexAttrTPtr>, ArgSpec<RestrictedIntPtr>]
1044       >,
1045       FunctionSpec<
1046           "pthread_mutexattr_setprotocol",
1047           RetValSpec<IntType>,
1048           [ArgSpec<RestrictedPThreadMutexAttrTPtr>, ArgSpec<IntType>]
1049       >,
1050       FunctionSpec<
1051           "pthread_mutexattr_getprioceiling",
1052           RetValSpec<IntType>,
1053           [ArgSpec<ConstRestrictedPThreadMutexAttrTPtr>, ArgSpec<RestrictedIntPtr>]
1054       >,
1055       FunctionSpec<
1056           "pthread_mutexattr_setprioceiling",
1057           RetValSpec<IntType>,
1058           [ArgSpec<RestrictedPThreadMutexAttrTPtr>, ArgSpec<IntType>]
1059       >,
1060       FunctionSpec<
1061           "pthread_mutex_init",
1062           RetValSpec<IntType>,
1063           [ArgSpec<RestrictedPThreadMutexTPtr>, ArgSpec<ConstRestrictedPThreadMutexAttrTPtr>]
1064       >,
1065       FunctionSpec<
1066           "pthread_mutex_destroy",
1067           RetValSpec<IntType>,
1068           [ArgSpec<PThreadMutexTPtr>]
1069       >,
1070       FunctionSpec<
1071           "pthread_mutex_lock",
1072           RetValSpec<IntType>,
1073           [ArgSpec<PThreadMutexTPtr>]
1074       >,
1075       FunctionSpec<
1076           "pthread_mutex_unlock",
1077           RetValSpec<IntType>,
1078           [ArgSpec<PThreadMutexTPtr>]
1079       >,
1080       FunctionSpec<
1081           "pthread_key_create",
1082           RetValSpec<IntType>,
1083           [ArgSpec<PThreadKeyTPtr>, ArgSpec<PThreadTSSDtorT>]
1084       >,
1085       FunctionSpec<
1086           "pthread_key_delete",
1087           RetValSpec<IntType>,
1088           [ArgSpec<PThreadKeyT>]
1089       >,
1090       FunctionSpec<
1091           "pthread_getspecific",
1092           RetValSpec<VoidPtr>,
1093           [ArgSpec<PThreadKeyT>]
1094       >,
1095       FunctionSpec<
1096           "pthread_setspecific",
1097           RetValSpec<VoidPtr>,
1098           [ArgSpec<PThreadKeyT>, ArgSpec<ConstVoidPtr>]
1099       >,
1100       FunctionSpec<
1101           "pthread_once",
1102           RetValSpec<IntType>,
1103           [ArgSpec<PThreadOnceTPtr>, ArgSpec<PThreadOnceCallback>]
1104       >,
1105     ]
1106   >;
1108   HeaderSpec StdIO = HeaderSpec<
1109       "stdio.h",
1110       [], // Macros
1111       [], // Types
1112       [], // Enumerations
1113       [
1114           FunctionSpec<
1115               "flockfile",
1116               RetValSpec<VoidType>,
1117               [ArgSpec<FILEPtr>]
1118           >,
1119           FunctionSpec<
1120               "funlockfile",
1121               RetValSpec<VoidType>,
1122               [ArgSpec<FILEPtr>]
1123           >,
1124           FunctionSpec<
1125               "getc_unlocked",
1126               RetValSpec<IntType>,
1127               [ArgSpec<FILEPtr>]
1128           >,
1129           FunctionSpec<
1130               "getchar_unlocked",
1131               RetValSpec<IntType>,
1132               [ArgSpec<VoidType>]
1133           >,
1134       ]
1135   >;
1137   HeaderSpec Dirent = HeaderSpec<
1138       "dirent.h",
1139       [], // Macros
1140       [InoT, StructDirent, DIR], // Types
1141       [], // Enumerations
1142       [
1143           FunctionSpec<
1144               "alphasort",
1145               RetValSpec<IntType>,
1146               [ArgSpec<ConstStructDirentPtrPtr>, ArgSpec<ConstStructDirentPtrPtr>]
1147           >,
1148           FunctionSpec<
1149               "closedir",
1150               RetValSpec<IntType>,
1151               [ArgSpec<DIRPtr>]
1152           >,
1153           FunctionSpec<
1154               "dirfd",
1155               RetValSpec<IntType>,
1156               [ArgSpec<DIRPtr>]
1157           >,
1158           FunctionSpec<
1159               "fdopendir",
1160               RetValSpec<DIRPtr>,
1161               [ArgSpec<IntType>]
1162           >,
1163           FunctionSpec<
1164               "opendir",
1165               RetValSpec<DIRPtr>,
1166               [ArgSpec<ConstCharPtr>]
1167           >,
1168           FunctionSpec<
1169               "readdir",
1170               RetValSpec<StructDirentPtr>,
1171               [ArgSpec<DIRPtr>]
1172           >,
1173       ]
1174   >;
1176   HeaderSpec Time = HeaderSpec<
1177       "time.h",
1178       [], // Macros
1179       [ClockIdT, StructTimeSpec, StructTimevalType], // Types
1180       [], // Enumerations
1181       [
1182           FunctionSpec<
1183               "clock_gettime",
1184               RetValSpec<IntType>,
1185               [ArgSpec<ClockIdT>, ArgSpec<StructTimeSpecPtr>]
1186           >,
1187           FunctionSpec<
1188               "gettimeofday",
1189               RetValSpec<IntType>,
1190               [ArgSpec<StructTimevalPtr>, ArgSpec<VoidPtr>]
1191           >,
1192           FunctionSpec<
1193               "nanosleep",
1194               RetValSpec<IntType>,
1195               [ArgSpec<StructTimeSpecPtr>, ArgSpec<StructTimeSpecPtr>]
1196           >,
1197       ]
1198   >;
1200   HeaderSpec SysWait = HeaderSpec<
1201     "sys/wait.h",
1202     [], // Macros
1203     [PidT, StructRUsage],
1204     [], // Enumerations
1205     [
1206       FunctionSpec<
1207         "wait",
1208         RetValSpec<PidT>,
1209         [ArgSpec<IntPtr>]
1210       >,
1211       FunctionSpec<
1212         "waitpid",
1213         RetValSpec<PidT>,
1214         [ArgSpec<PidT>, ArgSpec<IntPtr>, ArgSpec<IntType>]
1215       >
1216     ]
1217   >;
1219   HeaderSpec SysIOctl = HeaderSpec<
1220     "sys/ioctl.h",
1221     [
1222       Macro<"TIOCGETD">,
1223     ],  // Macros
1224     [], // Types
1225     [], // Enumerations
1226     []  // Functions
1227   >;
1229   HeaderSpec Spawn = HeaderSpec<
1230     "spawn.h",
1231     [], // Macros
1232     [ModeTType, PosixSpawnAttrT, PidT, PosixSpawnFileActionsT],
1233     [], // Enumerations
1234     [
1235       FunctionSpec<
1236         "posix_spawn_file_actions_addclose",
1237         RetValSpec<IntType>,
1238         [ArgSpec<PosixSpawnFileActionsTPtr>, ArgSpec<IntType>]
1239       >,
1240       FunctionSpec<
1241         "posix_spawn_file_actions_adddup2",
1242         RetValSpec<IntType>,
1243         [ArgSpec<PosixSpawnFileActionsTPtr>, ArgSpec<IntType>, ArgSpec<IntType>]
1244       >,
1245       FunctionSpec<
1246         "posix_spawn_file_actions_addopen",
1247         RetValSpec<IntType>,
1248         [ArgSpec<PosixSpawnFileActionsTRestrictedPtr>, ArgSpec<IntType>,
1249          ArgSpec<ConstCharRestrictedPtr>, ArgSpec<IntType>, ArgSpec<ModeTType>]
1250       >,
1251       FunctionSpec<
1252         "posix_spawn_file_actions_destroy",
1253         RetValSpec<IntType>,
1254         [ArgSpec<PosixSpawnFileActionsTPtr>]
1255       >,
1256       FunctionSpec<
1257         "posix_spawn_file_actions_init",
1258         RetValSpec<IntType>,
1259         [ArgSpec<PosixSpawnFileActionsTPtr>]
1260       >,
1261       FunctionSpec<
1262         "posix_spawn",
1263         RetValSpec<IntType>,
1264         [ArgSpec<RestrictedPidTPtr>, ArgSpec<ConstCharRestrictedPtr>,
1265          ArgSpec<PosixSpawnFileActionsTPtr>, ArgSpec<RestrictedPosixSpawnAttrTPtrType>,
1266          ArgSpec<ConstCharRestrictedPtrPtr>, ArgSpec<ConstCharRestrictedPtrPtr>]
1267       >,
1268     ]
1269   >;
1271   HeaderSpec Termios = HeaderSpec<
1272     "termios.h",
1273     [
1274       Macro<"NCCS">,
1275     ],
1276     [CcT, PidT, SpeedT, StructTermios, TcFlagT], // Types
1277     [], // Enumerations
1278     [
1279       FunctionSpec<
1280         "cfgetispeed",
1281         RetValSpec<SpeedT>,
1282         [ArgSpec<ConstStructTermiosPtr>]
1283       >,
1284       FunctionSpec<
1285         "cfgetospeed",
1286         RetValSpec<SpeedT>,
1287         [ArgSpec<ConstStructTermiosPtr>]
1288       >,
1289       FunctionSpec<
1290         "cfsetispeed",
1291         RetValSpec<SpeedT>,
1292         [ArgSpec<StructTermiosPtr>, ArgSpec<SpeedT>]
1293       >,
1294       FunctionSpec<
1295         "cfsetospeed",
1296         RetValSpec<SpeedT>,
1297         [ArgSpec<StructTermiosPtr>, ArgSpec<SpeedT>]
1298       >,
1299       FunctionSpec<
1300         "tcdrain",
1301         RetValSpec<IntType>,
1302         [ArgSpec<IntType>]
1303       >,
1304       FunctionSpec<
1305         "tcflow",
1306         RetValSpec<IntType>,
1307         [ArgSpec<IntType>, ArgSpec<IntType>]
1308       >,
1309       FunctionSpec<
1310         "tcflush",
1311         RetValSpec<IntType>,
1312         [ArgSpec<IntType>, ArgSpec<IntType>]
1313       >,
1314       FunctionSpec<
1315         "tcgetattr",
1316         RetValSpec<IntType>,
1317         [ArgSpec<IntType>, ArgSpec<StructTermiosPtr>]
1318       >,
1319       FunctionSpec<
1320         "tcgetsid",
1321         RetValSpec<PidT>,
1322         [ArgSpec<IntType>]
1323       >,
1324       FunctionSpec<
1325         "tcsendbreak",
1326         RetValSpec<IntType>,
1327         [ArgSpec<IntType>, ArgSpec<IntType>]
1328       >,
1329       FunctionSpec<
1330         "tcsetattr",
1331         RetValSpec<IntType>,
1332         [ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<StructTermiosPtr>]
1333       >,
1334     ]
1335   >;
1337   HeaderSpec SysSelect = HeaderSpec<
1338     "sys/select.h",
1339     [], // Macros
1340     [FdSet, SigSetType, StructTimevalType, StructTimeSpec, SuSecondsT, TimeTType],
1341     [], // Enumerations
1342     [
1343       FunctionSpec<
1344         "select",
1345         RetValSpec<IntType>,
1346         [
1347             ArgSpec<IntType>, ArgSpec<RestrictedFdSetPtr>, ArgSpec<RestrictedFdSetPtr>,
1348             ArgSpec<RestrictedFdSetPtr>, ArgSpec<RestrictedStructTimevalPtr>
1349         ]
1350       >
1351     ]
1352   >;
1354   HeaderSpec SysSocket = HeaderSpec<
1355       "sys/socket.h",
1356       [
1357         Macro<"AF_UNSPEC">,
1358         Macro<"AF_UNIX">,
1359         Macro<"AF_LOCAL">,
1360         Macro<"AF_INET">,
1361         Macro<"AF_INET6">,
1362         Macro<"SOCK_STREAM">,
1363         Macro<"SOCK_DGRAM">,
1364         Macro<"SOCK_RAW">,
1365         Macro<"SOCK_RDM">,
1366         Macro<"SOCK_SEQPACKET">,
1367         Macro<"SOCK_PACKET">,
1368       ], // Macros
1369       [
1370         StructSockAddr, SAFamilyType,
1371       ], // Types
1372       [], // Enumerations
1373       [
1374         FunctionSpec<
1375           "socket",
1376           RetValSpec<IntType>,
1377           [ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<IntType>]
1378         >,
1379       ]  // Functions
1380   >;
1382   HeaderSpec SysTypes = HeaderSpec<
1383     "sys/types.h",
1384     [], // Macros
1385     [BlkCntT, BlkSizeT, ClockIdT, DevT, GidT, InoT, ModeTType, NLinkT, OffTType, PidT,
1386      PThreadAttrTType, PThreadKeyT, PThreadMutexTType, PThreadMutexAttrTType, PThreadOnceT, PThreadTType,
1387      SizeTType, SSizeTType, SuSecondsT, TimeTType, UidT],
1388     [], // Enumerations
1389     []  // Functions
1390   >;
1392   let Headers = [
1393     ArpaInet,
1394     CType,
1395     Dirent,
1396     Errno,
1397     FCntl,
1398     PThread,
1399     Sched,
1400     Signal,
1401     Spawn,
1402     StdIO,
1403     StdLib,
1404     SysIOctl,
1405     SysMMan,
1406     SysResource,
1407     SysSelect,
1408     SysSocket,
1409     SysStat,
1410     SysTypes,
1411     SysUtsName,
1412     SysWait,
1413     Time,
1414     Termios,
1415     UniStd,
1416     String
1417   ];