[Reland][Runtimes] Merge 'compile_commands.json' files from runtimes build (#116303)
[llvm-project.git] / libc / config / linux / api.td
bloba00e0f61b90df74ee28614a6ed71d2cac03dc222
1 include "config/public_api.td"
3 include "spec/stdc.td"
4 include "spec/posix.td"
5 include "spec/linux.td"
6 include "spec/gnu_ext.td"
7 include "spec/bsd_ext.td"
8 include "spec/stdc_ext.td"
9 include "spec/llvm_libc_ext.td"
10 include "spec/llvm_libc_stdfix_ext.td"
12 def CTypeAPI : PublicAPI<"ctype.h"> {
15 def FCntlAPI : PublicAPI<"fcntl.h"> {
16   let Types = [
17     "mode_t",
18     "off_t",
19   ];
22 def IntTypesAPI : PublicAPI<"inttypes.h"> {
23   let Types = ["imaxdiv_t"];
26 def MathAPI : PublicAPI<"math.h"> {
27   let Types = ["double_t", "float_t", "float128"];
30 def FenvAPI: PublicAPI<"fenv.h"> {
31   let Types = ["fenv_t", "fexcept_t"];
34 def StringAPI : PublicAPI<"string.h"> {
35   let Types = ["size_t"];
38 def StdIOAPI : PublicAPI<"stdio.h"> {
39   let Macros = [
40     SimpleMacroDef<"stderr", "stderr">,
41     SimpleMacroDef<"stdin", "stdin">,
42     SimpleMacroDef<"stdout", "stdout">,
43   ];
44   let Types = [
45     "FILE",
46     "cookie_io_functions_t",
47     "off_t",
48     "size_t",
49   ];
52 def StdlibAPI : PublicAPI<"stdlib.h"> {
53   let Types = [
54     "div_t",
55     "ldiv_t",
56     "lldiv_t",
57     "size_t",
58     "__bsearchcompare_t",
59     "__qsortcompare_t",
60     "__qsortrcompare_t",
61     "__atexithandler_t",
62   ];
65 def TimeAPI : PublicAPI<"time.h"> {
66   let Types = [
67     "clock_t",
68     "time_t",
69     "struct tm",
70     "struct timespec",
71     "struct timeval",
72     "clockid_t",
73   ];
76 def SchedAPI : PublicAPI<"sched.h"> {
77   let Types = [
78     "pid_t",
79     "size_t",
80     "cpu_set_t",
81     "struct sched_param",
82     // Needed according to posix standard
83     "time_t",
84     "struct timespec",
85   ];
88 def SysMManAPI : PublicAPI<"sys/mman.h"> {
89   let Types = ["off_t", "size_t", "mode_t"];
92 def SignalAPI : PublicAPI<"signal.h"> {
93   let Types = [
94     "sig_atomic_t",
95     "sigset_t",
96     "struct sigaction",
97     "union sigval",
98     "siginfo_t",
99     "stack_t",
100     "pid_t",
101   ];
104 def ThreadsAPI : PublicAPI<"threads.h"> {
105   let Macros = [
106     SimpleMacroDef<"ONCE_FLAG_INIT", "{0}">,
107   ];
109   let Types = [
110     "__call_once_func_t",
111     "once_flag",
112     "cnd_t",
113     "mtx_t",
114     "thrd_t",
115     "thrd_start_t",
116     "tss_t",
117     "tss_dtor_t",
118   ];
120   let Enumerations = [
121     "mtx_plain",
122     "mtx_recursive",
123     "mtx_timed",
124     "thrd_timedout",
125     "thrd_success",
126     "thrd_busy",
127     "thrd_error",
128     "thrd_nomem",
129   ];
132 def PThreadAPI : PublicAPI<"pthread.h"> {
133   let Types = [
134       "__atfork_callback_t",
135       "__pthread_once_func_t",
136       "__pthread_start_t",
137       "__pthread_tss_dtor_t",
138       "pthread_attr_t",
139       "pthread_condattr_t",
140       "pthread_key_t",
141       "pthread_mutex_t",
142       "pthread_mutexattr_t",
143       "pthread_once_t",
144       "pthread_rwlockattr_t",
145       "pthread_rwlock_t",
146       "pthread_spinlock_t",
147       "pthread_t",
148   ];
151 def DirentAPI : PublicAPI<"dirent.h"> {
152   let Types = [
153     "ino_t",
154     "DIR",
155     "struct dirent",
156   ];
159 def UniStdAPI : PublicAPI<"unistd.h"> {
160   let Types = ["__exec_argv_t", "__exec_envp_t", "off_t", "pid_t", "size_t",
161                "ssize_t", "uid_t", "__getoptargv_t"];
164 def WCharAPI : PublicAPI<"wchar.h"> {
165   let Types = [
166     "wchar_t",
167     "wint_t",
168     "size_t",
169   ];
172 def UCharAPI : PublicAPI<"uchar.h"> {
173   let Types = [
174     "mbstate_t",
175     "char8_t",
176     "char16_t",
177     "char32_t",
178   ];
181 def SysRandomAPI : PublicAPI<"sys/random.h"> {
182   let Types = ["size_t", "ssize_t"];
185 def SysSelectAPI : PublicAPI<"sys/select.h"> {
186   let Types = ["fd_set", "sigset_t", "suseconds_t", "time_t", "struct timespec",
187                "struct timeval"];
190 def SysSocketAPI : PublicAPI<"sys/socket.h"> {
191   let Types = [
192     "sa_family_t",
193     "socklen_t",
194     "struct sockaddr",
195     "struct sockaddr_un",
196     "struct msghdr",
197     "struct iovec",
198     "size_t",
199     "ssize_t",
200   ];
203 def SysResourceAPI : PublicAPI<"sys/resource.h"> {
204   let Types = ["rlim_t", "struct rlimit"];
207 def SysStatAPI : PublicAPI<"sys/stat.h"> {
208   let Types = ["mode_t", "dev_t", "ino_t", "nlink_t", "uid_t", "gid_t", "off_t",
209                "struct timespec", "struct timeval", "blksize_t", "blkcnt_t",
210                "struct stat"];
213 def SysWaitAPI : PublicAPI<"sys/wait.h"> {
214   let Types = ["pid_t", "struct rusage", "siginfo_t"];
217 def SysSendfileAPI : PublicAPI<"sys/sendfile.h"> {
218   let Types = ["off_t", "size_t", "ssize_t"];
221 def SysTypesAPI : PublicAPI<"sys/types.h"> {
222   let Types = [
223     "blkcnt_t",
224     "blksize_t",
225     "clockid_t",
226     "dev_t",
227     "gid_t",
228     "ino_t",
229     "mode_t",
230     "nlink_t",
231     "off_t",
232     "pid_t",
233     "pthread_attr_t",
234     "pthread_condattr_t",
235     "pthread_key_t",
236     "pthread_mutex_t",
237     "pthread_mutexattr_t",
238     "pthread_once_t",
239     "pthread_rwlockattr_t",
240     "pthread_rwlock_t",
241     "pthread_t",
242     "size_t",
243     "ssize_t",
244     "suseconds_t",
245     "time_t",
246     "uid_t"
247   ];
250 def SysUtsNameAPI : PublicAPI<"sys/utsname.h"> {
251   let Types = ["struct utsname"];
254 def SysEpollAPI : PublicAPI<"sys/epoll.h"> {
255   let Types = ["struct epoll_event", "struct epoll_data", "sigset_t", "struct timespec"];
258 def SpawnAPI : PublicAPI<"spawn.h"> {
259   let Types = ["mode_t", "pid_t", "posix_spawnattr_t", "posix_spawn_file_actions_t"];
262 def TermiosAPI : PublicAPI<"termios.h"> {
263   let Types = ["cc_t", "pid_t", "speed_t", "struct termios", "tcflag_t"];
266 def SetJmpAPI : PublicAPI<"setjmp.h"> {
267   let Types = ["jmp_buf"];
270 def SearchAPI : PublicAPI<"search.h"> {
271   let Types = ["ACTION", "ENTRY", "struct hsearch_data", "__lsearchcompare_t"];
274 def SysStatvfsAPI : PublicAPI<"sys/statvfs.h"> {
275   let Types = ["struct statvfs"];