llvm-project
1752 строки · 46.7 Кб
1def SigSetType : NamedType<"sigset_t">;
2def SigSetPtrType : PtrType<SigSetType>;
3def ConstSigSetPtrType : ConstType<SigSetPtrType>;
4def RestrictedSigSetType : RestrictedPtrType<SigSetType>;
5def ConstRestrictedSigSetType : ConstType<RestrictedSigSetType>;
6
7def SigInfoType : NamedType<"siginfo_t">;
8def UnionSigVal : NamedType<"union sigval">;
9
10def StructSigaction : NamedType<"struct sigaction">;
11def StructSigactionPtr : PtrType<StructSigaction>;
12def ConstStructSigactionPtr : ConstType<StructSigactionPtr>;
13def RestrictedStructSigactionPtr : RestrictedPtrType<StructSigaction>;
14def ConstRestrictedStructSigactionPtr : ConstType<RestrictedStructSigactionPtr>;
15
16def PThreadStartT : NamedType<"__pthread_start_t">;
17def PThreadTSSDtorT : NamedType<"__pthread_tss_dtor_t">;
18def PThreadKeyT : NamedType<"pthread_key_t">;
19def PThreadKeyTPtr : PtrType<PThreadKeyT>;
20def PThreadOnceT : NamedType<"pthread_once_t">;
21def PThreadOnceTPtr : PtrType<PThreadOnceT>;
22def PThreadOnceCallback : NamedType<"__pthread_once_func_t">;
23
24def InoT : NamedType<"ino_t">;
25def UidT : NamedType<"uid_t">;
26def GidT : NamedType<"gid_t">;
27def DevT : NamedType<"dev_t">;
28def ClockIdT : NamedType<"clockid_t">;
29def RestrictedClockIdTPtr : RestrictedPtrType<ClockIdT>;
30def BlkSizeT : NamedType<"blksize_t">;
31def BlkCntT : NamedType<"blkcnt_t">;
32def NLinkT : NamedType<"nlink_t">;
33
34def StatType : NamedType<"struct stat">;
35def StatTypePtr : PtrType<StatType>;
36def RestrictedStatTypePtr : RestrictedPtrType<StatType>;
37
38def DIR : NamedType<"DIR">;
39def DIRPtr : PtrType<DIR>;
40def DIRRestrictedPtr : RestrictedPtrType<DIR>;
41def StructDirent : NamedType<"struct dirent">;
42def StructDirentPtr : PtrType<StructDirent>;
43def StructDirentPtrPtr : PtrType<StructDirentPtr>;
44def ConstStructDirentPtrPtr : ConstType<StructDirentPtrPtr>;
45
46def StructSchedParam : NamedType<"struct sched_param">;
47def StructSchedParamPtr : PtrType<StructSchedParam>;
48def ConstStructSchedParamPtr : ConstType<StructSchedParamPtr>;
49
50def ExecArgvT : NamedType<"__exec_argv_t">;
51def ExecEnvpT : NamedType<"__exec_envp_t">;
52
53def AtForkCallbackT : NamedType<"__atfork_callback_t">;
54
55def PosixSpawnFileActionsT : NamedType<"posix_spawn_file_actions_t">;
56def PosixSpawnFileActionsTPtr : PtrType<PosixSpawnFileActionsT>;
57def ConstPosixSpawnFileActionsTPtr : ConstType<PosixSpawnFileActionsTPtr>;
58def PosixSpawnFileActionsTRestrictedPtr : RestrictedPtrType<PosixSpawnFileActionsT>;
59
60def PosixSpawnAttrT : NamedType<"posix_spawnattr_t">;
61def RestrictedPosixSpawnAttrTPtrType : RestrictedPtrType<PosixSpawnAttrT>;
62
63def CcT : NamedType<"cc_t">;
64def SpeedT : NamedType<"speed_t">;
65def StructTermios : NamedType<"struct termios">;
66def StructTermiosPtr : PtrType<StructTermios>;
67def ConstStructTermiosPtr : ConstType<StructTermiosPtr>;
68def TcFlagT : NamedType<"tcflag_t">;
69
70def StackT : NamedType<"stack_t">;
71def StackTPtr : PtrType<StackT>;
72def RestrictedStackTPtr : RestrictedPtrType<StackT>;
73def ConstRestrictedStackTPtr : ConstType<RestrictedStackTPtr>;
74
75def FdSet : NamedType<"fd_set">;
76def FdSetPtr : PtrType<FdSet>;
77def RestrictedFdSetPtr : RestrictedPtrType<FdSet>;
78
79def GetoptArgvT : NamedType<"__getoptargv_t">;
80
81def SAFamilyType : NamedType<"sa_family_t">;
82def SocklenType : NamedType<"socklen_t">;
83
84def StructSockAddr : NamedType<"struct sockaddr">;
85def StructSockAddrPtr : PtrType<StructSockAddr>;
86def ConstStructSockAddrPtr : ConstType<StructSockAddrPtr>;
87
88def StructSockAddrUn : NamedType<"struct sockaddr_un">;
89
90def StructStatvfs : NamedType<"struct statvfs">;
91def StructStatvfsPtr : PtrType<StructStatvfs>;
92def RestrictedStructStatvfsPtr : RestrictedPtrType<StructStatvfs>;
93
94def POSIX : StandardSpec<"POSIX"> {
95PtrType CharPtr = PtrType<CharType>;
96RestrictedPtrType RestrictedCharPtr = RestrictedPtrType<CharType>;
97RestrictedPtrType CharRestrictedDoublePtr = RestrictedPtrType<CharPtr>;
98ConstType ConstCharPtr = ConstType<CharPtr>;
99ConstType ConstRestrictedCharPtr = ConstType<RestrictedCharPtr>;
100
101NamedType ModeTType = NamedType<"mode_t">;
102
103NamedType PThreadAttrTType = NamedType<"pthread_attr_t">;
104PtrType PThreadAttrTPtr = PtrType<PThreadAttrTType>;
105RestrictedPtrType RestrictedPThreadAttrTPtr = RestrictedPtrType<PThreadAttrTType>;
106ConstType ConstPThreadAttrTPtr = ConstType<PThreadAttrTPtr>;
107ConstType ConstRestrictedPThreadAttrTPtr = ConstType<RestrictedPThreadAttrTPtr>;
108
109NamedType PThreadCondAttrTType = NamedType<"pthread_condattr_t">;
110PtrType PThreadCondAttrTPtr = PtrType<PThreadCondAttrTType>;
111ConstType ConstRestrictedPThreadCondAttrTPtr = ConstType<RestrictedPtrType<PThreadCondAttrTType>>;
112
113NamedType PThreadRWLockAttrTType = NamedType<"pthread_rwlockattr_t">;
114PtrType PThreadRWLockAttrTPtr = PtrType<PThreadRWLockAttrTType>;
115ConstType ConstPThreadRWLockAttrTPtr = ConstType<PThreadRWLockAttrTPtr>;
116RestrictedPtrType RestrictedPThreadRWLockAttrTPtr = RestrictedPtrType<PThreadRWLockAttrTType>;
117ConstType ConstRestrictedPThreadRWLockAttrTPtr = ConstType<RestrictedPThreadRWLockAttrTPtr>;
118
119NamedType PThreadMutexAttrTType = NamedType<"pthread_mutexattr_t">;
120PtrType PThreadMutexAttrTPtr = PtrType<PThreadMutexAttrTType>;
121RestrictedPtrType RestrictedPThreadMutexAttrTPtr = RestrictedPtrType<PThreadMutexAttrTType>;
122ConstType ConstPThreadMutexAttrTPtr = ConstType<PThreadMutexAttrTPtr>;
123ConstType ConstRestrictedPThreadMutexAttrTPtr = ConstType<RestrictedPThreadMutexAttrTPtr>;
124
125NamedType PThreadMutexTType = NamedType<"pthread_mutex_t">;
126PtrType PThreadMutexTPtr = PtrType<PThreadMutexTType>;
127RestrictedPtrType RestrictedPThreadMutexTPtr = RestrictedPtrType<PThreadMutexTType>;
128ConstType ConstPThreadMutexTPtr = ConstType<PThreadMutexTPtr>;
129ConstType ConstRestrictedPThreadMutexTPtr = ConstType<RestrictedPThreadMutexTPtr>;
130
131NamedType PThreadRWLockTType = NamedType<"pthread_rwlock_t">;
132PtrType PThreadRWLockTPtr = PtrType<PThreadRWLockTType>;
133RestrictedPtrType RestrictedPThreadRWLockTPtr = RestrictedPtrType<PThreadRWLockTType>;
134
135PtrType PThreadTPtr = PtrType<PThreadTType>;
136RestrictedPtrType RestrictedPThreadTPtr = RestrictedPtrType<PThreadTType>;
137
138HeaderSpec Errno = HeaderSpec<
139"errno.h",
140[
141Macro<"E2BIG">,
142Macro<"EACCES">,
143Macro<"EADDRINUSE">,
144Macro<"EADDRNOTAVAIL">,
145Macro<"EAFNOSUPPORT">,
146Macro<"EAGAIN">,
147Macro<"EALREADY">,
148Macro<"EBADF">,
149Macro<"EBADMSG">,
150Macro<"EBUSY">,
151Macro<"ECANCELED">,
152Macro<"ECHILD">,
153Macro<"ECONNABORTED">,
154Macro<"ECONNREFUSED">,
155Macro<"ECONNRESET">,
156Macro<"EDEADLK">,
157Macro<"EDESTADDRREQ">,
158Macro<"EDQUOT">,
159Macro<"EEXIST">,
160Macro<"EFAULT">,
161Macro<"EFBIG">,
162Macro<"EHOSTUNREACH">,
163Macro<"EIDRM">,
164Macro<"EINPROGRESS">,
165Macro<"EINTR">,
166Macro<"EINVAL">,
167Macro<"EIO">,
168Macro<"EISCONN">,
169Macro<"EISDIR">,
170Macro<"ELOOP">,
171Macro<"EMFILE">,
172Macro<"EMLINK">,
173Macro<"EMSGSIZE">,
174Macro<"EMULTIHOP">,
175Macro<"ENAMETOOLONG">,
176Macro<"ENETDOWN">,
177Macro<"ENETRESET">,
178Macro<"ENETUNREACH">,
179Macro<"ENFILE">,
180Macro<"ENOBUFS">,
181Macro<"ENODATA">,
182Macro<"ENODEV">,
183Macro<"ENOENT">,
184Macro<"ENOEXEC">,
185Macro<"ENOLCK">,
186Macro<"ENOLINK">,
187Macro<"ENOMEM">,
188Macro<"ENOMSG">,
189Macro<"ENOPROTOOPT">,
190Macro<"ENOSPC">,
191Macro<"ENOSR">,
192Macro<"ENOSTR">,
193Macro<"ENOSYS">,
194Macro<"ENOTCONN">,
195Macro<"ENOTDIR">,
196Macro<"ENOTEMPTY">,
197Macro<"ENOTRECOVERABLE">,
198Macro<"ENOTSOCK">,
199Macro<"ENOTSUP">,
200Macro<"ENOTTY">,
201Macro<"ENXIO">,
202Macro<"EOPNOTSUPP">,
203Macro<"EOVERFLOW">,
204Macro<"EOWNERDEAD">,
205Macro<"EPERM">,
206Macro<"EPIPE">,
207Macro<"EPROTO">,
208Macro<"EPROTONOSUPPORT">,
209Macro<"EPROTOTYPE">,
210Macro<"EROFS">,
211Macro<"ESPIPE">,
212Macro<"ESRCH">,
213Macro<"ESTALE">,
214Macro<"ETIME">,
215Macro<"ETIMEDOUT">,
216Macro<"ETXTBSY">,
217Macro<"EWOULDBLOCK">,
218Macro<"EXDEV">,
219],
220[], // Types
221[], // Enumerations
222[] // Functions
223>;
224
225HeaderSpec DlFcn = HeaderSpec<
226"dlfcn.h",
227[
228Macro<"RTLD_LAZY">,
229Macro<"RTLD_NOW">,
230Macro<"RTLD_GLOBAL">,
231Macro<"RTLD_LOCAL">,
232],
233[], // Types
234[], // Enumerations
235[
236FunctionSpec<
237"dlclose",
238RetValSpec<IntType>,
239[ArgSpec<VoidPtr>]
240>,
241FunctionSpec<
242"dlerror",
243RetValSpec<CharPtr>,
244[]
245>,
246FunctionSpec<
247"dlopen",
248RetValSpec<VoidPtr>,
249[ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
250>,
251FunctionSpec<
252"dlsym",
253RetValSpec<VoidPtr>,
254[ArgSpec<VoidRestrictedPtr>, ArgSpec<ConstCharRestrictedPtr>]
255>,
256]
257>;
258
259HeaderSpec FCntl = HeaderSpec<
260"fcntl.h",
261[], // Macros
262[
263ModeTType,
264OffTType,
265],
266[], // Enumerations
267[
268FunctionSpec<
269"creat",
270RetValSpec<IntType>,
271[ArgSpec<ConstCharPtr>, ArgSpec<ModeTType>]
272>,
273FunctionSpec<
274"fcntl",
275RetValSpec<IntType>,
276[ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<VarArgType>]
277>,
278FunctionSpec<
279"open",
280RetValSpec<IntType>,
281[ArgSpec<ConstCharPtr>, ArgSpec<IntType>, ArgSpec<VarArgType>]
282>,
283FunctionSpec<
284"openat",
285RetValSpec<IntType>,
286[ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>, ArgSpec<VarArgType>]
287>,
288]
289>;
290
291HeaderSpec SysMMan = HeaderSpec<
292"sys/mman.h",
293[
294// TODO: Add a facility to bunch macros into bitwise-or-able groups.
295// POSIX requires it, so such thing should be captured in this spec.
296Macro<"PROT_EXEC">,
297Macro<"PROT_NONE">,
298Macro<"PROT_READ">,
299Macro<"PROT_WRITE">,
300
301Macro<"MAP_FIXED">,
302Macro<"MAP_PRIVATE">,
303Macro<"MAP_SHARED">,
304
305Macro<"MAP_FAILED">,
306],
307[
308SizeTType,
309OffTType,
310ModeTType,
311],
312[], // Enumerations
313[
314FunctionSpec<
315"madvise",
316RetValSpec<IntType>,
317[ArgSpec<VoidPtr>,
318ArgSpec<SizeTType>,
319ArgSpec<IntType>]
320>,
321FunctionSpec<
322"mmap",
323RetValSpec<VoidPtr>,
324[ArgSpec<VoidPtr>,
325ArgSpec<SizeTType>,
326ArgSpec<IntType>,
327ArgSpec<IntType>,
328ArgSpec<IntType>,
329ArgSpec<OffTType>]
330>,
331FunctionSpec<
332"mprotect",
333RetValSpec<IntType>,
334[ArgSpec<VoidPtr>,
335ArgSpec<SizeTType>,
336ArgSpec<IntType>]
337>,
338FunctionSpec<
339"munmap",
340RetValSpec<IntType>,
341[ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
342>,
343FunctionSpec<
344"posix_madvise",
345RetValSpec<IntType>,
346[ArgSpec<VoidPtr>,
347ArgSpec<SizeTType>,
348ArgSpec<IntType>]
349>,
350FunctionSpec<
351"mlock",
352RetValSpec<IntType>,
353[ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
354>,
355FunctionSpec<
356"munlock",
357RetValSpec<IntType>,
358[ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
359>,
360FunctionSpec<
361"mlockall",
362RetValSpec<IntType>,
363[ArgSpec<IntType>]
364>,
365FunctionSpec<
366"munlockall",
367RetValSpec<IntType>,
368[ArgSpec<VoidType>]
369>,
370FunctionSpec<
371"msync",
372RetValSpec<IntType>,
373[ArgSpec<VoidPtr>, ArgSpec<SizeTType>, ArgSpec<IntType>]
374>,
375FunctionSpec<
376"shm_open",
377RetValSpec<IntType>,
378[ArgSpec<ConstCharPtr>, ArgSpec<IntType>, ArgSpec<ModeTType>]
379>,
380FunctionSpec<
381"shm_unlink",
382RetValSpec<IntType>,
383[ArgSpec<ConstCharPtr>]
384>,
385]
386>;
387
388HeaderSpec Signal = HeaderSpec<
389"signal.h",
390[], // Macros
391[
392SigInfoType,
393SigSetType,
394StackT,
395StructSigaction,
396UnionSigVal,
397PidT,
398],
399[], // Enumerations
400[
401FunctionSpec<
402"kill",
403RetValSpec<IntType>,
404[ArgSpec<PidT>,
405ArgSpec<IntType>]
406>,
407FunctionSpec<
408"sigaction",
409RetValSpec<IntType>,
410[ArgSpec<IntType>,
411ArgSpec<ConstRestrictedStructSigactionPtr>,
412ArgSpec<RestrictedStructSigactionPtr>]
413>,
414FunctionSpec<
415"sigaltstack",
416RetValSpec<IntType>,
417[ArgSpec<ConstRestrictedStackTPtr>, ArgSpec<RestrictedStackTPtr>]
418>,
419FunctionSpec<
420"sigdelset",
421RetValSpec<IntType>,
422[ArgSpec<SigSetPtrType>,
423ArgSpec<IntType>]
424>,
425FunctionSpec<
426"sigprocmask",
427RetValSpec<IntType>,
428[ArgSpec<IntType>, ArgSpec<ConstRestrictedSigSetType>, ArgSpec<RestrictedSigSetType>]
429>,
430FunctionSpec<
431"sigemptyset",
432RetValSpec<IntType>,
433[ArgSpec<SigSetPtrType>]
434>,
435FunctionSpec<
436"sigaddset",
437RetValSpec<IntType>,
438[ArgSpec<SigSetPtrType>,
439ArgSpec<IntType>]
440>,
441FunctionSpec<
442"sigfillset",
443RetValSpec<IntType>,
444[ArgSpec<SigSetPtrType>]
445>,
446]
447>;
448
449HeaderSpec UniStd = HeaderSpec<
450"unistd.h",
451[], // Macros
452[
453ExecArgvT,
454ExecEnvpT,
455OffTType,
456SSizeTType,
457SizeTType,
458PidT,
459UidT,
460GetoptArgvT,
461],
462[], // Enumerations
463[
464FunctionSpec<
465"_exit",
466RetValSpec<NoReturn>,
467[ArgSpec<IntType>]
468>,
469FunctionSpec<
470"access",
471RetValSpec<IntType>,
472[ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
473>,
474FunctionSpec<
475"chdir",
476RetValSpec<IntType>,
477[ArgSpec<ConstCharPtr>]
478>,
479FunctionSpec<
480"dup",
481RetValSpec<IntType>,
482[ArgSpec<IntType>]
483>,
484FunctionSpec<
485"dup2",
486RetValSpec<IntType>,
487[ArgSpec<IntType>, ArgSpec<IntType>]
488>,
489FunctionSpec<
490"dup3",
491RetValSpec<IntType>,
492[ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<IntType>]
493>,
494FunctionSpec<
495"fchdir",
496RetValSpec<IntType>,
497[ArgSpec<IntType>]
498>,
499FunctionSpec<
500"getcwd",
501RetValSpec<CharPtr>,
502[ArgSpec<CharPtr>, ArgSpec<SizeTType>]
503>,
504FunctionSpec<
505"close",
506RetValSpec<IntType>,
507[ArgSpec<IntType>]
508>,
509FunctionSpec<
510"execv",
511RetValSpec<IntType>,
512[ArgSpec<ConstCharPtr>, ArgSpec<ExecArgvT>]
513>,
514FunctionSpec<
515"execve",
516RetValSpec<IntType>,
517[ArgSpec<ConstCharPtr>, ArgSpec<ExecArgvT>, ArgSpec<ExecEnvpT>]
518>,
519FunctionSpec<
520"fork",
521RetValSpec<PidT>,
522[ArgSpec<VoidType>]
523>,
524FunctionSpec<
525"fsync",
526RetValSpec<IntType>,
527[ArgSpec<IntType>]
528>,
529FunctionSpec<
530"ftruncate",
531RetValSpec<IntType>,
532[ArgSpec<IntType>, ArgSpec<OffTType>]
533>,
534FunctionSpec<
535"geteuid",
536RetValSpec<UidT>,
537[ArgSpec<VoidType>]
538>,
539FunctionSpec<
540"getpid",
541RetValSpec<PidT>,
542[ArgSpec<VoidType>]
543>,
544FunctionSpec<
545"getppid",
546RetValSpec<PidT>,
547[ArgSpec<VoidType>]
548>,
549FunctionSpec<
550"getuid",
551RetValSpec<UidT>,
552[ArgSpec<VoidType>]
553>,
554FunctionSpec<
555"isatty",
556RetValSpec<IntType>,
557[ArgSpec<IntType>]
558>,
559FunctionSpec<
560"link",
561RetValSpec<IntType>,
562[ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
563>,
564FunctionSpec<
565"linkat",
566RetValSpec<IntType>,
567[ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
568>,
569FunctionSpec<
570"lseek",
571RetValSpec<OffTType>,
572[ArgSpec<IntType>, ArgSpec<OffTType>, ArgSpec<IntType>]
573>,
574FunctionSpec<
575"pread",
576RetValSpec<SSizeTType>,
577[ArgSpec<IntType>, ArgSpec<VoidPtr>, ArgSpec<SizeTType>, ArgSpec<OffTType>]
578>,
579FunctionSpec<
580"pwrite",
581RetValSpec<SSizeTType>,
582[ArgSpec<IntType>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>, ArgSpec<OffTType>]
583>,
584FunctionSpec<
585"read",
586RetValSpec<SSizeTType>,
587[ArgSpec<IntType>, ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
588>,
589FunctionSpec<
590"readlink",
591RetValSpec<SSizeTType>,
592[ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtr>, ArgSpec<SizeTType>]
593>,
594FunctionSpec<
595"readlinkat",
596RetValSpec<SSizeTType>,
597[ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtr>, ArgSpec<SizeTType>]
598>,
599FunctionSpec<
600"rmdir",
601RetValSpec<IntType>,
602[ArgSpec<ConstCharPtr>]
603>,
604FunctionSpec<
605"getpid",
606RetValSpec<IntType>,
607[ArgSpec<VoidType>]
608>,
609FunctionSpec<
610"getppid",
611RetValSpec<IntType>,
612[ArgSpec<VoidType>]
613>,
614FunctionSpec<
615"link",
616RetValSpec<IntType>,
617[ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
618>,
619FunctionSpec<
620"linkat",
621RetValSpec<IntType>,
622[ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
623>,
624FunctionSpec<
625"lseek",
626RetValSpec<OffTType>,
627[ArgSpec<IntType>, ArgSpec<OffTType>, ArgSpec<IntType>]
628>,
629FunctionSpec<
630"pipe",
631RetValSpec<IntType>,
632[ArgSpec<IntPtr>] //TODO: make this int[2]
633>,
634FunctionSpec<
635"pread",
636RetValSpec<SSizeTType>,
637[ArgSpec<IntType>, ArgSpec<VoidPtr>, ArgSpec<SizeTType>, ArgSpec<OffTType>]
638>,
639FunctionSpec<
640"pwrite",
641RetValSpec<SSizeTType>,
642[ArgSpec<IntType>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>, ArgSpec<OffTType>]
643>,
644FunctionSpec<
645"read",
646RetValSpec<SSizeTType>,
647[ArgSpec<IntType>, ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
648>,
649FunctionSpec<
650"readlink",
651RetValSpec<SSizeTType>,
652[ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtr>, ArgSpec<SizeTType>]
653>,
654FunctionSpec<
655"readlinkat",
656RetValSpec<SSizeTType>,
657[ArgSpec<ConstCharRestrictedPtr>, ArgSpec<CharRestrictedPtr>, ArgSpec<SizeTType>]
658>,
659FunctionSpec<
660"rmdir",
661RetValSpec<IntType>,
662[ArgSpec<ConstCharPtr>]
663>,
664FunctionSpec<
665"swab",
666RetValSpec<VoidType>,
667[ArgSpec<ConstVoidRestrictedPtr>, ArgSpec<VoidPtr>, ArgSpec<SSizeTType>]
668>,
669FunctionSpec<
670"symlink",
671RetValSpec<IntType>,
672[ArgSpec<ConstCharPtr>, ArgSpec<ConstCharPtr>]
673>,
674FunctionSpec<
675"symlinkat",
676RetValSpec<IntType>,
677[ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>, ArgSpec<ConstCharPtr>]
678>,
679FunctionSpec<
680"sysconf",
681RetValSpec<IntType>,
682[ArgSpec<IntType>]
683>,
684FunctionSpec<
685"__llvm_libc_syscall",
686RetValSpec<LongType>,
687[ArgSpec<LongType>,ArgSpec<LongType>,ArgSpec<LongType>,ArgSpec<LongType>,ArgSpec<LongType>,ArgSpec<LongType>,ArgSpec<LongType>]
688>,
689FunctionSpec<
690"truncate",
691RetValSpec<IntType>,
692[ArgSpec<ConstCharPtr>, ArgSpec<OffTType>]
693>,
694FunctionSpec<
695"unlink",
696RetValSpec<IntType>,
697[ArgSpec<ConstCharPtr>]
698>,
699FunctionSpec<
700"unlinkat",
701RetValSpec<IntType>,
702[ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<IntType>]
703>,
704FunctionSpec<
705"write",
706RetValSpec<SSizeTType>,
707[ArgSpec<IntType>, ArgSpec<ConstVoidPtr>, ArgSpec<SizeTType>]
708>,
709FunctionSpec<
710"getopt",
711RetValSpec<IntType>,
712[ArgSpec<IntType>, ArgSpec<GetoptArgvT>, ArgSpec<ConstCharPtr>]
713>,
714],
715[
716ObjectSpec<"environ", "char **">,
717ObjectSpec<
718"optarg",
719"char *"
720>,
721ObjectSpec<
722"optind",
723"int"
724>,
725ObjectSpec<
726"opterr",
727"int"
728>,
729ObjectSpec<
730"optopt",
731"int"
732>,
733]
734>;
735
736HeaderSpec StdLib = HeaderSpec<
737"stdlib.h",
738[], // Macros
739[], // Types
740[], // Enumerations
741[
742FunctionSpec<
743"getenv",
744RetValSpec<CharPtr>,
745[ArgSpec<ConstCharPtr>]
746>,
747]
748>;
749
750HeaderSpec Sched = HeaderSpec<
751"sched.h",
752[], // Macros
753[PidT, TimeTType, StructTimeSpec, StructSchedParam], // Types
754[], // Enumerations
755[
756FunctionSpec<
757"sched_yield",
758RetValSpec<IntType>,
759[ArgSpec<VoidType>]
760>,
761FunctionSpec<
762"sched_setparam",
763RetValSpec<IntType>,
764[ArgSpec<PidT>, ArgSpec<ConstStructSchedParamPtr>]
765>,
766
767FunctionSpec<
768"sched_getparam",
769RetValSpec<IntType>,
770[ArgSpec<PidT>, ArgSpec<StructSchedParamPtr>]
771>,
772
773FunctionSpec<
774"sched_setscheduler",
775RetValSpec<IntType>,
776[ArgSpec<PidT>]
777>,
778
779FunctionSpec<
780"sched_getscheduler",
781RetValSpec<IntType>,
782[ArgSpec<PidT>, ArgSpec<IntType>, ArgSpec<ConstStructSchedParamPtr>]
783>,
784
785FunctionSpec<
786"sched_get_priority_min",
787RetValSpec<IntType>,
788[ArgSpec<IntType>]
789>,
790
791FunctionSpec<
792"sched_get_priority_max",
793RetValSpec<IntType>,
794[ArgSpec<IntType>]
795>,
796
797FunctionSpec<
798"sched_rr_get_interval",
799RetValSpec<IntType>,
800[ArgSpec<PidT>, ArgSpec<StructTimeSpecPtr>]
801>,
802]
803>;
804
805HeaderSpec String = HeaderSpec<
806"string.h",
807[
808Macro<"NULL">,
809],
810[
811SizeTType,
812],
813[], // Enumerations
814[
815FunctionSpec<
816"memccpy",
817RetValSpec<VoidPtr>,
818[ArgSpec<VoidRestrictedPtr>,
819ArgSpec<ConstVoidRestrictedPtr>,
820ArgSpec<IntType>,
821ArgSpec<SizeTType>]
822>,
823FunctionSpec<
824"mempcpy",
825RetValSpec<VoidPtr>,
826[ArgSpec<VoidRestrictedPtr>,
827ArgSpec<ConstVoidRestrictedPtr>,
828ArgSpec<SizeTType>]
829>,
830FunctionSpec<
831"stpcpy",
832RetValSpec<CharPtr>,
833[ArgSpec<RestrictedCharPtr>,
834ArgSpec<ConstRestrictedCharPtr>]
835>,
836FunctionSpec<
837"stpncpy",
838RetValSpec<CharPtr>,
839[ArgSpec<RestrictedCharPtr>,
840ArgSpec<ConstRestrictedCharPtr>,
841ArgSpec<SizeTType>]
842>,
843FunctionSpec<
844"strnlen",
845RetValSpec<SizeTType>,
846[ArgSpec<ConstCharPtr>, ArgSpec<SizeTType>]
847>,
848FunctionSpec<
849"strtok_r",
850RetValSpec<CharPtr>,
851[ArgSpec<RestrictedCharPtr>,
852ArgSpec<ConstRestrictedCharPtr>,
853ArgSpec<CharRestrictedDoublePtr>]
854>,
855FunctionSpec<
856"strsignal",
857RetValSpec<CharPtr>,
858[ArgSpec<IntType>]
859>,
860]
861>;
862
863HeaderSpec CType = HeaderSpec<
864"ctype.h",
865[], // Macros
866[], // Types
867[], // Enumerations
868[
869FunctionSpec<
870"isascii",
871RetValSpec<IntType>,
872[ArgSpec<IntType>]
873>,
874]
875>;
876
877NamedType RLimTType = NamedType<"rlim_t">;
878NamedType StructRLimitType = NamedType<"struct rlimit">;
879PtrType StructRLimitPtr = PtrType<StructRLimitType>;
880ConstType ConstStructRLimitPtr = ConstType<StructRLimitType>;
881HeaderSpec SysResource = HeaderSpec<
882"sys/resource.h",
883[], // Macros
884[RLimTType, StructRLimitType], // Types
885[], // Enumerations
886[
887FunctionSpec<
888"getrlimit",
889RetValSpec<IntType>,
890[ArgSpec<StructRLimitPtr>]
891>,
892FunctionSpec<
893"setrlimit",
894RetValSpec<IntType>,
895[ArgSpec<ConstStructRLimitPtr>]
896>,
897]
898>;
899
900HeaderSpec SysStat = HeaderSpec<
901"sys/stat.h",
902[], // Macros
903[
904ModeTType,
905DevT,
906InoT,
907UidT,
908GidT,
909StructTimeSpec,
910StructTimevalType,
911BlkSizeT,
912BlkCntT,
913OffTType,
914NLinkT,
915StatType,
916], // Types
917[], // Enumerations
918[
919FunctionSpec<
920"chmod",
921RetValSpec<IntType>,
922[ArgSpec<ConstCharPtr>, ArgSpec<ModeTType>]
923>,
924FunctionSpec<
925"fchmod",
926RetValSpec<IntType>,
927[ArgSpec<IntType>, ArgSpec<ModeTType>]
928>,
929FunctionSpec<
930"fchmodat",
931RetValSpec<IntType>,
932[ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<ModeTType>, ArgSpec<IntType>]
933>,
934FunctionSpec<
935"fstat",
936RetValSpec<IntType>,
937[ArgSpec<IntType>, ArgSpec<StatTypePtr>]
938>,
939FunctionSpec<
940"lstat",
941RetValSpec<IntType>,
942[ArgSpec<ConstRestrictedCharPtr>, ArgSpec<RestrictedStatTypePtr>]
943>,
944FunctionSpec<
945"mkdir",
946RetValSpec<IntType>,
947[ArgSpec<ConstCharPtr>, ArgSpec<ModeTType>]
948>,
949FunctionSpec<
950"mkdirat",
951RetValSpec<IntType>,
952[ArgSpec<IntType>, ArgSpec<ConstCharPtr>, ArgSpec<ModeTType>]
953>,
954FunctionSpec<
955"stat",
956RetValSpec<IntType>,
957[ArgSpec<ConstRestrictedCharPtr>, ArgSpec<RestrictedStatTypePtr>]
958>,
959]
960>;
961
962HeaderSpec SysStatvfs = HeaderSpec<
963"sys/statvfs.h",
964[], // Macros
965[StructStatvfs], // Types
966[], // Enumerations
967[
968FunctionSpec<
969"statvfs",
970RetValSpec<IntType>,
971[
972ArgSpec<ConstRestrictedCharPtr>,
973ArgSpec<RestrictedStructStatvfsPtr>
974]
975>,
976FunctionSpec<
977"fstatvfs",
978RetValSpec<IntType>,
979[
980ArgSpec<IntType>,
981ArgSpec<StructStatvfsPtr>
982]
983>,
984] // Functions
985>;
986
987NamedType StructUtsName = NamedType<"struct utsname">;
988PtrType StructUtsNamePtr = PtrType<StructUtsName>;
989HeaderSpec SysUtsName = HeaderSpec<
990"sys/utsname.h",
991[], // Macros
992[StructUtsName], // Types
993[], // Enumerations
994[
995FunctionSpec<
996"uname",
997RetValSpec<IntType>,
998[ArgSpec<StructUtsNamePtr>]
999>,
1000]
1001>;
1002
1003HeaderSpec ArpaInet = HeaderSpec<
1004"arpa/inet.h",
1005[], // Macros
1006[], // Types
1007[], // Enumerations
1008[
1009FunctionSpec<
1010"htonl",
1011RetValSpec<UInt32Type>,
1012[ArgSpec<UInt32Type>]
1013>,
1014FunctionSpec<
1015"htons",
1016RetValSpec<UInt16Type>,
1017[ArgSpec<UInt16Type>]
1018>,
1019FunctionSpec<
1020"ntohl",
1021RetValSpec<UInt32Type>,
1022[ArgSpec<UInt32Type>]
1023>,
1024FunctionSpec<
1025"ntohs",
1026RetValSpec<UInt16Type>,
1027[ArgSpec<UInt16Type>]
1028>,
1029]
1030>;
1031
1032HeaderSpec PThread = HeaderSpec<
1033"pthread.h",
1034[], // Macros
1035[
1036AtForkCallbackT,
1037ClockIdT,
1038PThreadAttrTType,
1039PThreadCondAttrTType,
1040PThreadKeyT,
1041PThreadMutexAttrTType,
1042PThreadMutexTType,
1043PThreadOnceCallback,
1044PThreadOnceT,
1045PThreadRWLockAttrTType,
1046PThreadRWLockTType,
1047PThreadStartT,
1048PThreadTSSDtorT,
1049PThreadTType,
1050], // Types
1051[], // Enumerations
1052[
1053FunctionSpec<
1054"pthread_atfork",
1055RetValSpec<IntType>,
1056[ArgSpec<AtForkCallbackT>, ArgSpec<AtForkCallbackT>, ArgSpec<AtForkCallbackT>]
1057>,
1058FunctionSpec<
1059"pthread_attr_init",
1060RetValSpec<IntType>,
1061[ArgSpec<PThreadAttrTPtr>]
1062>,
1063FunctionSpec<
1064"pthread_attr_destroy",
1065RetValSpec<IntType>,
1066[ArgSpec<PThreadAttrTPtr>]
1067>,
1068FunctionSpec<
1069"pthread_attr_getdetachstate",
1070RetValSpec<IntType>,
1071[ArgSpec<ConstPThreadAttrTPtr>, ArgSpec<IntPtr>]
1072>,
1073FunctionSpec<
1074"pthread_attr_setdetachstate",
1075RetValSpec<IntType>,
1076[ArgSpec<PThreadAttrTPtr>, ArgSpec<IntType>]
1077>,
1078FunctionSpec<
1079"pthread_attr_getguardsize",
1080RetValSpec<IntType>,
1081[ArgSpec<ConstRestrictedPThreadAttrTPtr>, ArgSpec<RestrictedSizeTPtr>]
1082>,
1083FunctionSpec<
1084"pthread_attr_setguardsize",
1085RetValSpec<IntType>,
1086[ArgSpec<PThreadAttrTPtr>, ArgSpec<SizeTType>]
1087>,
1088FunctionSpec<
1089"pthread_attr_getstacksize",
1090RetValSpec<IntType>,
1091[ArgSpec<ConstRestrictedPThreadAttrTPtr>, ArgSpec<RestrictedSizeTPtr>]
1092>,
1093FunctionSpec<
1094"pthread_attr_setstacksize",
1095RetValSpec<IntType>,
1096[ArgSpec<PThreadAttrTPtr>, ArgSpec<SizeTType>]
1097>,
1098FunctionSpec<
1099"pthread_attr_getstack",
1100RetValSpec<IntType>,
1101[ArgSpec<ConstRestrictedPThreadAttrTPtr>, ArgSpec<RestrictedVoidPtrPtr>, ArgSpec<RestrictedSizeTPtr>]
1102>,
1103FunctionSpec<
1104"pthread_attr_setstack",
1105RetValSpec<IntType>,
1106[ArgSpec<PThreadAttrTPtr>, ArgSpec<VoidPtr>, ArgSpec<SizeTType>]
1107>,
1108FunctionSpec<
1109"pthread_condattr_destroy",
1110RetValSpec<IntType>,
1111[ArgSpec<PThreadCondAttrTPtr>]
1112>,
1113FunctionSpec<
1114"pthread_condattr_getclock",
1115RetValSpec<IntType>,
1116[ArgSpec<ConstRestrictedPThreadCondAttrTPtr>, ArgSpec<RestrictedClockIdTPtr>]
1117>,
1118FunctionSpec<
1119"pthread_condattr_getpshared",
1120RetValSpec<IntType>,
1121[ArgSpec<ConstRestrictedPThreadCondAttrTPtr>, ArgSpec<RestrictedIntPtr>]
1122>,
1123FunctionSpec<
1124"pthread_condattr_init",
1125RetValSpec<IntType>,
1126[ArgSpec<PThreadCondAttrTPtr>]
1127>,
1128FunctionSpec<
1129"pthread_condattr_setclock",
1130RetValSpec<IntType>,
1131[ArgSpec<PThreadCondAttrTPtr>, ArgSpec<ClockIdT>]
1132>,
1133FunctionSpec<
1134"pthread_condattr_setpshared",
1135RetValSpec<IntType>,
1136[ArgSpec<PThreadCondAttrTPtr>, ArgSpec<IntType>]
1137>,
1138FunctionSpec<
1139"pthread_create",
1140RetValSpec<IntType>,
1141[ArgSpec<RestrictedPThreadTPtr>, ArgSpec<ConstRestrictedPThreadAttrTPtr>, ArgSpec<PThreadStartT>, ArgSpec<VoidPtr>]
1142>,
1143FunctionSpec<
1144"pthread_join",
1145RetValSpec<IntType>,
1146[ArgSpec<PThreadTType>, ArgSpec<VoidPtrPtr>]
1147>,
1148FunctionSpec<
1149"pthread_detach",
1150RetValSpec<IntType>,
1151[ArgSpec<PThreadTType>]
1152>,
1153FunctionSpec<
1154"pthread_exit",
1155RetValSpec<NoReturn>,
1156[ArgSpec<VoidPtr>]
1157>,
1158FunctionSpec<
1159"pthread_self",
1160RetValSpec<PThreadTType>,
1161[ArgSpec<VoidType>]
1162>,
1163FunctionSpec<
1164"pthread_equal",
1165RetValSpec<IntType>,
1166[ArgSpec<PThreadTType>, ArgSpec<PThreadTType>]
1167>,
1168FunctionSpec<
1169"pthread_mutexattr_init",
1170RetValSpec<IntType>,
1171[ArgSpec<PThreadMutexAttrTPtr>]
1172>,
1173FunctionSpec<
1174"pthread_mutexattr_destroy",
1175RetValSpec<IntType>,
1176[ArgSpec<PThreadMutexAttrTPtr>]
1177>,
1178FunctionSpec<
1179"pthread_mutexattr_gettype",
1180RetValSpec<IntType>,
1181[ArgSpec<ConstRestrictedPThreadMutexAttrTPtr>, ArgSpec<RestrictedIntPtr>]
1182>,
1183FunctionSpec<
1184"pthread_mutexattr_settype",
1185RetValSpec<IntType>,
1186[ArgSpec<RestrictedPThreadMutexAttrTPtr>, ArgSpec<IntType>]
1187>,
1188FunctionSpec<
1189"pthread_mutexattr_getrobust",
1190RetValSpec<IntType>,
1191[ArgSpec<ConstRestrictedPThreadMutexAttrTPtr>, ArgSpec<RestrictedIntPtr>]
1192>,
1193FunctionSpec<
1194"pthread_mutexattr_setrobust",
1195RetValSpec<IntType>,
1196[ArgSpec<RestrictedPThreadMutexAttrTPtr>, ArgSpec<IntType>]
1197>,
1198FunctionSpec<
1199"pthread_mutexattr_getpshared",
1200RetValSpec<IntType>,
1201[ArgSpec<ConstRestrictedPThreadMutexAttrTPtr>, ArgSpec<RestrictedIntPtr>]
1202>,
1203FunctionSpec<
1204"pthread_mutexattr_setpshared",
1205RetValSpec<IntType>,
1206[ArgSpec<RestrictedPThreadMutexAttrTPtr>, ArgSpec<IntType>]
1207>,
1208FunctionSpec<
1209"pthread_mutexattr_getprotocol",
1210RetValSpec<IntType>,
1211[ArgSpec<ConstRestrictedPThreadMutexAttrTPtr>, ArgSpec<RestrictedIntPtr>]
1212>,
1213FunctionSpec<
1214"pthread_mutexattr_setprotocol",
1215RetValSpec<IntType>,
1216[ArgSpec<RestrictedPThreadMutexAttrTPtr>, ArgSpec<IntType>]
1217>,
1218FunctionSpec<
1219"pthread_mutexattr_getprioceiling",
1220RetValSpec<IntType>,
1221[ArgSpec<ConstRestrictedPThreadMutexAttrTPtr>, ArgSpec<RestrictedIntPtr>]
1222>,
1223FunctionSpec<
1224"pthread_mutexattr_setprioceiling",
1225RetValSpec<IntType>,
1226[ArgSpec<RestrictedPThreadMutexAttrTPtr>, ArgSpec<IntType>]
1227>,
1228FunctionSpec<
1229"pthread_mutex_init",
1230RetValSpec<IntType>,
1231[ArgSpec<RestrictedPThreadMutexTPtr>, ArgSpec<ConstRestrictedPThreadMutexAttrTPtr>]
1232>,
1233FunctionSpec<
1234"pthread_mutex_destroy",
1235RetValSpec<IntType>,
1236[ArgSpec<PThreadMutexTPtr>]
1237>,
1238FunctionSpec<
1239"pthread_mutex_lock",
1240RetValSpec<IntType>,
1241[ArgSpec<PThreadMutexTPtr>]
1242>,
1243FunctionSpec<
1244"pthread_mutex_unlock",
1245RetValSpec<IntType>,
1246[ArgSpec<PThreadMutexTPtr>]
1247>,
1248FunctionSpec<
1249"pthread_key_create",
1250RetValSpec<IntType>,
1251[ArgSpec<PThreadKeyTPtr>, ArgSpec<PThreadTSSDtorT>]
1252>,
1253FunctionSpec<
1254"pthread_key_delete",
1255RetValSpec<IntType>,
1256[ArgSpec<PThreadKeyT>]
1257>,
1258FunctionSpec<
1259"pthread_getspecific",
1260RetValSpec<VoidPtr>,
1261[ArgSpec<PThreadKeyT>]
1262>,
1263FunctionSpec<
1264"pthread_setspecific",
1265RetValSpec<VoidPtr>,
1266[ArgSpec<PThreadKeyT>, ArgSpec<ConstVoidPtr>]
1267>,
1268FunctionSpec<
1269"pthread_once",
1270RetValSpec<IntType>,
1271[ArgSpec<PThreadOnceTPtr>, ArgSpec<PThreadOnceCallback>]
1272>,
1273FunctionSpec<
1274"pthread_rwlockattr_destroy",
1275RetValSpec<IntType>,
1276[ArgSpec<PThreadRWLockAttrTPtr>]
1277>,
1278FunctionSpec<
1279"pthread_rwlockattr_getkind_np",
1280RetValSpec<IntType>,
1281[ArgSpec<PThreadRWLockAttrTPtr>, ArgSpec<IntPtr>]
1282>,
1283FunctionSpec<
1284"pthread_rwlockattr_getpshared",
1285RetValSpec<IntType>,
1286[ArgSpec<ConstPThreadRWLockAttrTPtr>, ArgSpec<IntPtr>]
1287>,
1288FunctionSpec<
1289"pthread_rwlockattr_init",
1290RetValSpec<IntType>,
1291[ArgSpec<PThreadRWLockAttrTPtr>]
1292>,
1293FunctionSpec<
1294"pthread_rwlockattr_setkind_np",
1295RetValSpec<IntType>,
1296[ArgSpec<PThreadRWLockAttrTPtr>, ArgSpec<IntType>]
1297>,
1298FunctionSpec<
1299"pthread_rwlockattr_setpshared",
1300RetValSpec<IntType>,
1301[ArgSpec<PThreadRWLockAttrTPtr>, ArgSpec<IntType>]
1302>,
1303FunctionSpec<
1304"pthread_rwlock_init",
1305RetValSpec<IntType>,
1306[ArgSpec<PThreadRWLockTPtr>, ArgSpec<ConstRestrictedPThreadRWLockAttrTPtr>]
1307>,
1308FunctionSpec<
1309"pthread_rwlock_tryrdlock",
1310RetValSpec<IntType>,
1311[ArgSpec<PThreadRWLockTPtr>]
1312>,
1313FunctionSpec<
1314"pthread_rwlock_trywrlock",
1315RetValSpec<IntType>,
1316[ArgSpec<PThreadRWLockTPtr>]
1317>,
1318FunctionSpec<
1319"pthread_rwlock_timedrdlock",
1320RetValSpec<IntType>,
1321[ArgSpec<RestrictedPThreadRWLockTPtr>, ArgSpec<ConstRestrictStructTimeSpecPtr>]
1322>,
1323FunctionSpec<
1324"pthread_rwlock_timedwrlock",
1325RetValSpec<IntType>,
1326[ArgSpec<RestrictedPThreadRWLockTPtr>, ArgSpec<ConstRestrictStructTimeSpecPtr>]
1327>,
1328FunctionSpec<
1329"pthread_rwlock_rdlock",
1330RetValSpec<IntType>,
1331[ArgSpec<PThreadRWLockTPtr>]
1332>,
1333FunctionSpec<
1334"pthread_rwlock_wrlock",
1335RetValSpec<IntType>,
1336[ArgSpec<PThreadRWLockTPtr>]
1337>,
1338FunctionSpec<
1339"pthread_rwlock_unlock",
1340RetValSpec<IntType>,
1341[ArgSpec<PThreadRWLockTPtr>]
1342>,
1343FunctionSpec<
1344"pthread_rwlock_destroy",
1345RetValSpec<IntType>,
1346[ArgSpec<PThreadRWLockTPtr>]
1347>,
1348]
1349>;
1350
1351HeaderSpec StdIO = HeaderSpec<
1352"stdio.h",
1353[], // Macros
1354[OffTType], // Types
1355[], // Enumerations
1356[
1357FunctionSpec<
1358"flockfile",
1359RetValSpec<VoidType>,
1360[ArgSpec<FILEPtr>]
1361>,
1362FunctionSpec<
1363"funlockfile",
1364RetValSpec<VoidType>,
1365[ArgSpec<FILEPtr>]
1366>,
1367FunctionSpec<
1368"getc_unlocked",
1369RetValSpec<IntType>,
1370[ArgSpec<FILEPtr>]
1371>,
1372FunctionSpec<
1373"getchar_unlocked",
1374RetValSpec<IntType>,
1375[ArgSpec<VoidType>]
1376>,
1377FunctionSpec<
1378"fileno",
1379RetValSpec<IntType>,
1380[ArgSpec<FILEPtr>]
1381>,
1382FunctionSpec<
1383"fdopen",
1384RetValSpec<FILEPtr>,
1385[ArgSpec<IntType>, ArgSpec<ConstCharPtr>]
1386>,
1387]
1388>;
1389
1390HeaderSpec Dirent = HeaderSpec<
1391"dirent.h",
1392[], // Macros
1393[InoT, StructDirent, DIR], // Types
1394[], // Enumerations
1395[
1396FunctionSpec<
1397"alphasort",
1398RetValSpec<IntType>,
1399[ArgSpec<ConstStructDirentPtrPtr>, ArgSpec<ConstStructDirentPtrPtr>]
1400>,
1401FunctionSpec<
1402"closedir",
1403RetValSpec<IntType>,
1404[ArgSpec<DIRPtr>]
1405>,
1406FunctionSpec<
1407"dirfd",
1408RetValSpec<IntType>,
1409[ArgSpec<DIRPtr>]
1410>,
1411FunctionSpec<
1412"fdopendir",
1413RetValSpec<DIRPtr>,
1414[ArgSpec<IntType>]
1415>,
1416FunctionSpec<
1417"opendir",
1418RetValSpec<DIRPtr>,
1419[ArgSpec<ConstCharPtr>]
1420>,
1421FunctionSpec<
1422"readdir",
1423RetValSpec<StructDirentPtr>,
1424[ArgSpec<DIRPtr>]
1425>,
1426]
1427>;
1428
1429HeaderSpec Time = HeaderSpec<
1430"time.h",
1431[], // Macros
1432[ClockIdT, StructTimeSpec, StructTimevalType], // Types
1433[], // Enumerations
1434[
1435FunctionSpec<
1436"clock_gettime",
1437RetValSpec<IntType>,
1438[ArgSpec<ClockIdT>, ArgSpec<StructTimeSpecPtr>]
1439>,
1440FunctionSpec<
1441"gettimeofday",
1442RetValSpec<IntType>,
1443[ArgSpec<StructTimevalPtr>, ArgSpec<VoidPtr>]
1444>,
1445FunctionSpec<
1446"nanosleep",
1447RetValSpec<IntType>,
1448[ArgSpec<ConstStructTimeSpecPtr>, ArgSpec<StructTimeSpecPtr>]
1449>,
1450]
1451>;
1452
1453HeaderSpec SysWait = HeaderSpec<
1454"sys/wait.h",
1455[], // Macros
1456[PidT, StructRUsage, SigInfoType],
1457[], // Enumerations
1458[
1459FunctionSpec<
1460"wait",
1461RetValSpec<PidT>,
1462[ArgSpec<IntPtr>]
1463>,
1464FunctionSpec<
1465"waitpid",
1466RetValSpec<PidT>,
1467[ArgSpec<PidT>, ArgSpec<IntPtr>, ArgSpec<IntType>]
1468>
1469]
1470>;
1471
1472HeaderSpec SysIOctl = HeaderSpec<
1473"sys/ioctl.h",
1474[
1475Macro<"TIOCGETD">,
1476], // Macros
1477[], // Types
1478[], // Enumerations
1479[] // Functions
1480>;
1481
1482HeaderSpec Spawn = HeaderSpec<
1483"spawn.h",
1484[], // Macros
1485[ModeTType, PosixSpawnAttrT, PidT, PosixSpawnFileActionsT],
1486[], // Enumerations
1487[
1488FunctionSpec<
1489"posix_spawn_file_actions_addclose",
1490RetValSpec<IntType>,
1491[ArgSpec<PosixSpawnFileActionsTPtr>, ArgSpec<IntType>]
1492>,
1493FunctionSpec<
1494"posix_spawn_file_actions_adddup2",
1495RetValSpec<IntType>,
1496[ArgSpec<PosixSpawnFileActionsTPtr>, ArgSpec<IntType>, ArgSpec<IntType>]
1497>,
1498FunctionSpec<
1499"posix_spawn_file_actions_addopen",
1500RetValSpec<IntType>,
1501[ArgSpec<PosixSpawnFileActionsTRestrictedPtr>, ArgSpec<IntType>,
1502ArgSpec<ConstCharRestrictedPtr>, ArgSpec<IntType>, ArgSpec<ModeTType>]
1503>,
1504FunctionSpec<
1505"posix_spawn_file_actions_destroy",
1506RetValSpec<IntType>,
1507[ArgSpec<PosixSpawnFileActionsTPtr>]
1508>,
1509FunctionSpec<
1510"posix_spawn_file_actions_init",
1511RetValSpec<IntType>,
1512[ArgSpec<PosixSpawnFileActionsTPtr>]
1513>,
1514FunctionSpec<
1515"posix_spawn",
1516RetValSpec<IntType>,
1517[ArgSpec<RestrictedPidTPtr>, ArgSpec<ConstCharRestrictedPtr>,
1518ArgSpec<PosixSpawnFileActionsTPtr>, ArgSpec<RestrictedPosixSpawnAttrTPtrType>,
1519ArgSpec<ConstCharRestrictedPtrPtr>, ArgSpec<ConstCharRestrictedPtrPtr>]
1520>,
1521]
1522>;
1523
1524HeaderSpec Search = HeaderSpec<
1525"search.h",
1526[], // Macros
1527[
1528ActionType,
1529EntryType
1530], // Types
1531[], // Enumerations
1532[
1533FunctionSpec<
1534"hcreate",
1535RetValSpec<IntType>,
1536[
1537ArgSpec<SizeTType>
1538]
1539>,
1540FunctionSpec<
1541"hdestroy",
1542RetValSpec<VoidType>,
1543[] // Args
1544>,
1545FunctionSpec<
1546"hsearch",
1547RetValSpec<EntryTypePtr>,
1548[
1549ArgSpec<EntryType>,
1550ArgSpec<ActionType>
1551]
1552>,
1553FunctionSpec<
1554"insque",
1555RetValSpec<VoidType>,
1556[
1557ArgSpec<VoidPtr>,
1558ArgSpec<VoidPtr>
1559]
1560>,
1561FunctionSpec<
1562"remque",
1563RetValSpec<VoidType>,
1564[
1565ArgSpec<VoidPtr>
1566]
1567>,
1568]
1569>;
1570
1571HeaderSpec Termios = HeaderSpec<
1572"termios.h",
1573[
1574Macro<"NCCS">,
1575],
1576[CcT, PidT, SpeedT, StructTermios, TcFlagT], // Types
1577[], // Enumerations
1578[
1579FunctionSpec<
1580"cfgetispeed",
1581RetValSpec<SpeedT>,
1582[ArgSpec<ConstStructTermiosPtr>]
1583>,
1584FunctionSpec<
1585"cfgetospeed",
1586RetValSpec<SpeedT>,
1587[ArgSpec<ConstStructTermiosPtr>]
1588>,
1589FunctionSpec<
1590"cfsetispeed",
1591RetValSpec<SpeedT>,
1592[ArgSpec<StructTermiosPtr>, ArgSpec<SpeedT>]
1593>,
1594FunctionSpec<
1595"cfsetospeed",
1596RetValSpec<SpeedT>,
1597[ArgSpec<StructTermiosPtr>, ArgSpec<SpeedT>]
1598>,
1599FunctionSpec<
1600"tcdrain",
1601RetValSpec<IntType>,
1602[ArgSpec<IntType>]
1603>,
1604FunctionSpec<
1605"tcflow",
1606RetValSpec<IntType>,
1607[ArgSpec<IntType>, ArgSpec<IntType>]
1608>,
1609FunctionSpec<
1610"tcflush",
1611RetValSpec<IntType>,
1612[ArgSpec<IntType>, ArgSpec<IntType>]
1613>,
1614FunctionSpec<
1615"tcgetattr",
1616RetValSpec<IntType>,
1617[ArgSpec<IntType>, ArgSpec<StructTermiosPtr>]
1618>,
1619FunctionSpec<
1620"tcgetsid",
1621RetValSpec<PidT>,
1622[ArgSpec<IntType>]
1623>,
1624FunctionSpec<
1625"tcsendbreak",
1626RetValSpec<IntType>,
1627[ArgSpec<IntType>, ArgSpec<IntType>]
1628>,
1629FunctionSpec<
1630"tcsetattr",
1631RetValSpec<IntType>,
1632[ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<StructTermiosPtr>]
1633>,
1634]
1635>;
1636
1637HeaderSpec SysSelect = HeaderSpec<
1638"sys/select.h",
1639[], // Macros
1640[FdSet, SigSetType, StructTimevalType, StructTimeSpec, SuSecondsT, TimeTType],
1641[], // Enumerations
1642[
1643FunctionSpec<
1644"select",
1645RetValSpec<IntType>,
1646[
1647ArgSpec<IntType>, ArgSpec<RestrictedFdSetPtr>, ArgSpec<RestrictedFdSetPtr>,
1648ArgSpec<RestrictedFdSetPtr>, ArgSpec<RestrictedStructTimevalPtr>
1649]
1650>
1651]
1652>;
1653
1654HeaderSpec SysSocket = HeaderSpec<
1655"sys/socket.h",
1656[
1657Macro<"AF_UNSPEC">,
1658Macro<"AF_UNIX">,
1659Macro<"AF_LOCAL">,
1660Macro<"AF_INET">,
1661Macro<"AF_INET6">,
1662Macro<"SOCK_STREAM">,
1663Macro<"SOCK_DGRAM">,
1664Macro<"SOCK_RAW">,
1665Macro<"SOCK_RDM">,
1666Macro<"SOCK_SEQPACKET">,
1667Macro<"SOCK_PACKET">,
1668], // Macros
1669[
1670SAFamilyType,
1671StructSockAddr,
1672StructSockAddrUn,
1673SocklenType,
1674], // Types
1675[], // Enumerations
1676[
1677FunctionSpec<
1678"socket",
1679RetValSpec<IntType>,
1680[ArgSpec<IntType>, ArgSpec<IntType>, ArgSpec<IntType>]
1681>,
1682FunctionSpec<
1683"bind",
1684RetValSpec<IntType>,
1685[ArgSpec<IntType>, ArgSpec<ConstStructSockAddrPtr>, ArgSpec<SocklenType>]
1686>,
1687] // Functions
1688>;
1689
1690HeaderSpec SysTypes = HeaderSpec<
1691"sys/types.h",
1692[], // Macros
1693[
1694BlkCntT,
1695BlkSizeT,
1696ClockIdT,
1697DevT,
1698GidT,
1699InoT,
1700ModeTType,
1701NLinkT,
1702OffTType,
1703PThreadAttrTType,
1704PThreadCondAttrTType,
1705PThreadKeyT,
1706PThreadMutexAttrTType,
1707PThreadMutexTType,
1708PThreadOnceT,
1709PThreadRWLockAttrTType,
1710PThreadRWLockTType,
1711PThreadTType,
1712PidT,
1713SSizeTType,
1714SizeTType,
1715SuSecondsT,
1716TimeTType,
1717UidT
1718], // Types
1719[], // Enumerations
1720[] // Functions
1721>;
1722
1723let Headers = [
1724ArpaInet,
1725CType,
1726Dirent,
1727DlFcn,
1728Errno,
1729FCntl,
1730PThread,
1731Sched,
1732Signal,
1733Spawn,
1734StdIO,
1735StdLib,
1736SysIOctl,
1737SysMMan,
1738SysResource,
1739SysSelect,
1740SysSocket,
1741SysStat,
1742SysStatvfs,
1743SysTypes,
1744SysUtsName,
1745SysWait,
1746Time,
1747Termios,
1748UniStd,
1749String,
1750Search,
1751];
1752}
1753