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