libc.so.conf revision a09fb66ce739338ba1a1b4a64409d4b2ae789b86
1# See ltrace.conf(5) for description of syntax of this file.
2
3# arpa/inet.h
4typedef in_addr = struct(hex(uint));
5int inet_aton(string, +in_addr*);
6hex(uint) inet_addr(string);
7hex(uint) inet_network(string);
8string inet_ntoa(in_addr);
9in_addr inet_makeaddr(hex(int), hex(int));
10hex(uint) inet_lnaof(in_addr);
11hex(uint) inet_netof(in_addr);
12
13# bfd.h
14void bfd_init();
15int bfd_set_default_target(string);
16addr bfd_scan_vma(string, addr, int);
17addr bfd_openr(string,string);
18int bfd_check_format(addr,int);
19
20# ctype.h
21char tolower(char);
22char toupper(char);
23addr __ctype_b_loc();
24addr __ctype_tolower_loc();
25addr __ctype_toupper_loc();
26ulong __ctype_get_mb_cur_max();
27
28# curses.h
29int waddch(addr, char);
30int mvprintw(int, int, format);
31int wmove(addr, int, int);
32int waddnstr(addr, string, int);
33string tgoto(string, int, int);
34
35# dirent.h
36
37# We can't portably rely on DIR internals at all.  Ideally this would
38# be implemented in a per-OS config file, but even on Linux, we don't
39# know whether there's a lock in the structure or not.  Luckily the
40# one interesting datum, file descriptor, we can access reliably.
41# Having the structure half-defined like this is potentially
42# problematic as structure size influences parameter passing.  But
43# POSIX always uses pointer to the structure, so it's fine.
44
45typedef DIR = struct(int);
46typedef FILE = addr;
47
48# XXX We can't represent the following portably without having either
49# uulong, or directly uint64_t.'
50
51typedef ino_t = ulong;
52typedef ino_t64 = ulong;
53typedef off_t = ulong;
54typedef off_t64 = ulong;
55
56typedef dirent = struct(ino_t, hide(off_t), hide(ushort), hide(char), string(array(char, zero(256))));
57typedef dirent64 = struct(ino_t64, hide(off_t64), hide(ushort), hide(char), string(array(char, zero(256))));
58
59dirent *readdir(DIR *);
60dirent64 *readdir64(DIR *);
61int closedir(DIR *);
62DIR *opendir(string);
63DIR *fdopendir(int);
64int dirfd(DIR *);
65void rewinddir(DIR *);
66long telldir(DIR *);
67void seekdir(DIR *, long);
68
69# dlfcn.h
70addr  dlopen(string, int);
71string dlerror();
72addr  dlsym(addr, string);
73int dlclose(addr);
74
75# errno.h
76addr __errno_location();
77
78# fcntl.h
79int open(string,int,octal);		; WARNING: 3rd argument may not be there
80int open64(string,int,octal);		; WARNING: 3rd argument may not be there
81
82# fnmatch.h
83int fnmatch(string, string, int);
84
85# getopt.h
86int getopt_long(int,addr,string,addr,int*);
87int getopt_long_only(int,addr,string,addr,addr);
88
89# grp.h
90void endgrent();
91addr getgrnam(string);
92void setgrent();
93addr getgrent();
94
95# libintl.h
96string __dcgettext(string,string,int);
97string bindtextdomain(string, string);
98string textdomain(string);
99
100# libio.h
101char _IO_getc(file);
102int _IO_putc(char,file);
103
104# locale.h
105string setlocale(enum(LC_CTYPE=0, LC_NUMERIC=1, LC_TIME=2, LC_COLLATE=3, LC_MONETARY=4, LC_MESSAGES=5, LC_ALL=6, LC_PAPER=7, LC_NAME=8, LC_ADDRESS=9, LC_TELEPHONE=10, LC_MEASUREMENT=11, LC_IDENTIFICATION=12), string);
106
107# mcheck.h
108void mtrace();
109void muntrace();
110
111# mqueue.h
112int mq_open(string, int, octal, addr);  ; WARNING: 3rd and 4th arguments may not be there
113int mq_close(int);
114int mq_unlink(string);
115int mq_getattr(int, addr);
116int mq_setattr(int, addr, addr);
117int mq_notify(int, addr);
118int mq_send(int, string3, ulong, uint);
119int mq_timedsend(int, string3, ulong, uint, addr);
120long mq_receive(int, +string0, ulong, addr);
121long mq_timedreceive(int, +string0, ulong, addr, addr);
122
123# netdb.h
124void endhostent();
125void endnetent();
126void endnetgrent();
127void endprotoent();
128void endservent();
129void freeaddrinfo(addr);
130string gai_strerror(int);
131int getaddrinfo(string, string, addr, addr);
132addr gethostbyaddr(string, uint, int);
133addr gethostbyname(string);
134addr gethostent();
135int getnameinfo(addr, uint, string, uint, string, uint, uint);
136addr getnetbyaddr(uint, int);
137addr getnetbyname(string);
138addr getnetent();
139int getnetgrent(addr, addr, addr);
140addr getprotobyname(string);
141addr getprotobynumber(int);
142addr getprotoent();
143addr getservbyname(string, string);
144addr getservbyport(int, string);
145addr getservent();
146void herror(string);
147string hstrerror(int);
148int rcmd(addr, ushort, string, string, string, addr);
149int rcmd_af(addr, ushort, string, string, string, addr, int);
150int rexec(addr, int, string, string, string, addr);
151int rexec_af(addr, int, string, string, string, addr, int);
152int rresvport (addr);
153int rresvport_af (addr, int);
154int ruserok(string, int, string, string);
155int ruserok_af(string, int, string, string, int);
156void sethostent(int);
157void setnetent(int);
158int setnetgrent(string);
159void setprotoent(int);
160void setservent(int);
161
162# netinet/in.h
163uint ntohs(uint);
164
165# pcap.h
166string pcap_lookupdev(addr);
167addr pcap_open_live(string, int, int, int, addr);
168int pcap_snapshot(addr);
169int pcap_lookupnet(string, addr, addr, addr);
170int pcap_compile(addr, addr, string, int, addr);
171
172# pwd.h
173string getpass(string);
174void endpwent();
175addr getpwnam(string);
176void setpwent();
177
178# readline/readline.h
179string readline(string);
180
181# signal.h
182typedef signum = enum(SIGHUP=1, SIGINT=2, SIGQUIT=3, SIGILL=4, SIGTRAP=5, SIGABRT=6, SIGBUS=7, SIGFPE=8, SIGKILL=9, SIGUSR1=10, SIGSEGV=11, SIGUSR2=12, SIGPIPE=13, SIGALRM=14, SIGTERM=15, SIGSTKFLT=16, SIGCHLD=17, SIGCONT=18, SIGSTOP=19, SIGTSTP=20, SIGTTIN=21, SIGTTOU=22, SIGURG=23, SIGXCPU=24, SIGXFSZ=25, SIGVTALRM=26, SIGPROF=27, SIGWINCH=28, SIGIO=29, SIGPWR=30, SIGSYS=31, SIGRTMIN_0=32, SIGRTMIN_1=33, SIGRTMIN_2=34, SIGRTMIN_3=35, SIGRTMIN_4=36, SIGRTMIN_5=37, SIGRTMIN_6=38, SIGRTMIN_7=39, SIGRTMIN_8=40, SIGRTMIN_9=41, SIGRTMIN_10=42, SIGRTMIN_11=43, SIGRTMIN_12=44, SIGRTMIN_13=45, SIGRTMIN_14=46, SIGRTMIN_15=47, SIGRTMIN_16=48, SIGRTMIN_17=49, SIGRTMIN_18=50, SIGRTMIN_19=51, SIGRTMIN_20=52, SIGRTMIN_21=53, SIGRTMIN_22=54, SIGRTMIN_23=55, SIGRTMIN_24=56, SIGRTMIN_25=57, SIGRTMIN_26=58, SIGRTMIN_27=59, SIGRTMIN_28=60, SIGRTMIN_29=61, SIGRTMIN_30=62, SIGRTMIN_31=63);
183typedef sigset_t = bitvec(ulong);
184# elm3 should be flags
185typedef sigaction = struct(addr, sigset_t, hex(int), addr);
186int kill(int, signum);
187int sigemptyset(+sigset_t*);
188int sigaddset(+sigset_t*, signum);
189int sigdelset(+sigset_t*, signum);
190int sigfillset(+sigset_t*);
191int sigismember(sigset_t*, signum);
192addr signal(signum,addr);
193int sigaction(signum, sigaction*, +sigaction*);
194int sigprocmask(enum(SIG_BLOCK=1, SIG_UNBLOCK=2, SIG_SETMASK=3), sigset_t*, +sigset_t*);
195int sigpending(+sigset_t*);
196int sigsuspend(sigset_t*);
197int sigisemptyset(sigset_t*);
198int sigorset(+sigset_t*, sigset_t*, sigset_t*);
199int sigandset(+sigset_t*, sigset_t*, sigset_t*);
200
201# stdio.h
202int fclose(file);
203int feof(file);
204int ferror(file);
205int fflush(file);
206char fgetc(file);
207addr fgets(+string, int, file);
208int fileno(file);
209file fopen(string,string);
210file fopen64(string,string);
211file fdopen(int, string);
212int fprintf(file,format);
213int fputc(char,file);
214int fputs(string,file);
215ulong fread(addr,ulong,ulong,file);
216ulong fread_unlocked(addr,ulong,ulong,file);
217ulong fwrite(string,ulong,ulong,file);
218ulong fwrite_unlocked(string,ulong,ulong,file);
219int pclose(addr);
220void perror(string);
221addr popen(string, string);
222int printf(format);
223int puts(string);
224int remove(string);
225int snprintf(+string2,ulong,format);
226int sprintf(+string,format);
227string tempnam(string,string);
228int vfprintf(file,string,addr);
229int vsnprintf(+string2,ulong,string,addr);
230int setvbuf(file,addr,int,ulong);
231void setbuf(file,addr);
232void setbuffer(file,addr,ulong);
233void setlinebuf(file);
234int rename(string,string);
235
236# stdlib.h
237long __strtol_internal(string,addr,int);
238ulong __strtoul_internal(string,addr,int);
239int atexit(addr);
240addr bsearch(string, addr, ulong, ulong, addr);
241addr calloc(ulong, ulong);
242void exit(int);
243void free(addr);
244string getenv(string);
245int putenv(string);
246int setenv(string,string,int);
247void unsetenv(string);
248addr malloc(ulong);
249void qsort(addr,ulong,ulong,addr);
250addr realloc(addr,ulong);
251int system(string);
252
253int rand();
254int rand_r(uint*);
255void srand(uint);
256long random();
257void srandom(uint);
258void* initstate(uint, void*, ulong);
259void* setstate(void*);
260int random_r(void*, +int*);
261int srandom_r(uint, void*);
262int initstate_r(uint, void*, ulong, void*);
263int setstate_r(void*, void*);
264double drand48();
265double erand48(+array(ushort,3)*);
266long lrand48();
267long nrand48(+array(ushort,3)*);
268long mrand48();
269long jrand48(+array(ushort,3)*);
270void srand48(long);
271array(ushort,3)* seed48(array(ushort,3)*);
272void lcong48(array(ushort,7)*);
273
274# string.h
275void bcopy(addr,addr,ulong);
276void bzero(addr,ulong);
277string basename(string);
278string index(string,char);
279addr memchr(string,char,ulong);
280addr memcpy(addr,string(array(char, arg3)*),ulong);
281addr memmove(addr,string(array(char, arg3)*),ulong);
282addr memset(addr,char,long);
283string rindex(string,char);
284addr stpcpy(addr,string);
285int strcasecmp(string, string);
286string strcat(string, string);
287string strchr(string,char);
288int strcoll(string,string);
289ulong strlen(string);
290int strcmp(string,string);
291addr strcpy(addr,string);
292addr strdup(string);
293string strerror(int);
294int strncmp(string,string,ulong);
295addr strncpy(addr,string3,ulong);
296string strrchr(string,char);
297string strsep(addr,string);
298ulong strspn(string,string);
299ulong strcspn(string,string);
300string strstr(string,string);
301string strtok(string, string);
302
303# sys/ioctl.h
304int ioctl(int, int, addr);
305
306# sys/socket.h
307int socket(int,int,int);
308
309# sys/stat.h
310int __fxstat(int,int,addr);
311int __xstat(int,string,addr);
312int __lxstat(int,string,addr);
313int __fxstat64(int,int,addr);
314int __xstat64(int,string,addr);
315int __lxstat64(int,string,addr);
316int chmod(string,octal);
317int fchmod(int,octal);
318int mkfifo(string,octal);
319octal umask(octal);
320
321# sys/utsname.h
322int uname(addr);
323
324# sys/vfs.h
325int statfs(string,addr);
326
327# syslog.h
328void closelog();
329void openlog(string,int,int);
330void syslog(int,format);
331
332# term.h
333int tputs(string, int, addr);
334
335# termios.h
336int tcgetattr(int,addr);
337int tcsetattr(int,int,addr);
338
339# time.h
340string ctime(addr);
341int gettimeofday(addr, addr);
342addr gmtime(addr);
343addr localtime(addr);
344ulong strftime(+string2,ulong,string,addr);
345long time(addr);
346
347# unistd.h
348void _exit(int);
349int access(string, int);
350uint alarm(uint);
351int chdir(string);
352int chown(string,int,int);
353int close(int);
354string crypt(string,string);
355int dup2(int,int);
356int execlp(string,string,addr,addr,addr);
357int execv(string,addr);
358int fchdir(int);
359int fork();
360int ftruncate(int,ulong);
361string2 getcwd(addr,ulong);
362int getdomainname(+string2,ulong);
363int geteuid();
364int getegid();
365int getgid();
366int gethostname(+string2,ulong);
367string getlogin();
368int getopt(int,addr,string);
369int getpid();
370int getppid();
371int getuid();
372int getpgrp();
373int setpgrp();
374int getpgid(int);
375int isatty(int);
376int link(string,string);
377int mkdir(string,octal);
378long read(int, +string[retval], ulong);
379int rmdir(string);
380int seteuid(uint);
381int setgid(int);
382int sethostname(+string2,ulong);
383int setpgid(int,int);
384int setreuid(uint, uint);
385int setuid(int);
386uint sleep(uint);
387int symlink(string,string);
388int sync();
389int truncate(string,ulong);
390string ttyname(int);
391int unlink(string);
392void usleep(uint);
393long write(int, string3, ulong);
394addr sbrk(long);
395int getpagesize();
396long lseek(int,long,int);
397int pipe(addr);
398
399# utmp.h
400void endutent();
401addr getutent();
402void setutent();
403
404# wchar.h
405typedef wchar_t = string(uint);
406typedef wint_t = string(int);
407typedef wstring_t = string(array(uint, zero)*);
408typedef wstring2_t = string(array(uint, zero(arg2))*);
409typedef wstring3_t = string(array(uint, zero(arg3))*);
410
411int fwide(FILE*, int);
412wint_t btowc(int);
413
414wint_t getwc(FILE *);
415wint_t getwchar();
416wint_t fgetwc(FILE*);
417wstring_t fgetws(+wstring2_t, int, FILE*);
418wint_t ungetwc(wint_t, FILE*);
419
420wint_t fputwc(wchar_t, FILE*);
421int fputws(wstring_t, FILE*);
422wint_t putwc(wchar_t, FILE*);
423wint_t putwchar(wchar_t);
424
425int wprintf(format(wstring_t));
426int fwprintf(FILE*, format(wstring_t));
427int swprintf(+wstring2_t, ulong, format(wstring_t));
428int vfwprintf(FILE*, wstring_t, addr);
429int vwprintf(wstring_t, addr);
430int vswprintf(+wstring2_t, ulong, wstring_t, addr);
431
432; int wscanf(const wchar_t *restrict, ...);
433; int fwscanf(FILE *restrict, const wchar_t *restrict, ...);
434; int swscanf(const wchar_t *restrict, const wchar_t *restrict, ...);
435; int vfwscanf(FILE *restrict, const wchar_t *restrict, va_list);
436; int vswscanf(const wchar_t *restrict, const wchar_t *restrict, va_list);
437; int vwscanf(const wchar_t *restrict, va_list);
438
439int iswalnum(wint_t);
440int iswalpha(wint_t);
441int iswcntrl(wint_t);
442int iswdigit(wint_t);
443int iswgraph(wint_t);
444int iswlower(wint_t);
445int iswprint(wint_t);
446int iswpunct(wint_t);
447int iswspace(wint_t);
448int iswupper(wint_t);
449int iswxdigit(wint_t);
450uint wctype(string);
451int iswctype(wint_t, uint);
452
453ulong mbrlen(string, ulong, addr);
454ulong mbrtowc(+wchar_t*, string[arg3], ulong, addr);
455ulong mbsrtowcs(+wstring3_t, string*, ulong, addr);
456ulong wctomb(+string0, wchar_t);
457ulong wcrtomb(+string0, wchar_t, addr);
458ulong wcsrtombs(+string3, wstring_t*, ulong, addr);
459int mbsinit(addr);
460
461wint_t towlower(wint_t);
462wint_t towupper(wint_t);
463
464wstring_t wcscat(wstring_t, wstring_t);
465wstring_t wcsncat(wstring3_t, wstring_t, ulong);
466wstring_t wcschr(wstring_t, wchar_t);
467wstring_t wcsrchr(wstring_t, wchar_t);
468int wcscmp(wstring_t, wstring_t);
469int wcsncmp(wstring3_t, wstring3_t, ulong);
470int wcscoll(wstring_t, wstring_t);
471addr wcscpy(addr, wstring_t);
472addr wcsncpy(addr, wstring_t, ulong);
473ulong wcslen(wstring_t);
474
475wstring_t wcsstr(wstring_t, wstring_t);
476wstring_t wcswcs(wstring_t, wstring_t);
477
478ulong wcscspn(wstring_t, wstring_t);
479ulong wcsspn(wstring_t, wstring_t);
480wstring_t wcspbrk(wstring_t, wstring_t);
481wstring_t wcstok(wstring_t, wstring_t, +wstring_t*);
482
483ulong wcsftime(+wstring2_t, ulong, wstring_t, addr);
484
485# XXX ltrace misses long double and long long support
486typedef ldouble = double;
487typedef llong = long;
488typedef ullong = ulong;
489
490double wcstod(wstring_t, +wstring_t*);
491float wcstof(wstring_t, +wstring_t*);
492ldouble wcstold(wstring_t, +wstring_t*);
493long wcstol(wstring_t, +wstring_t*, int);
494llong wcstoll(wstring_t, +wstring_t*, int);
495ulong wcstoul(wstring_t, +wstring_t*, int);
496ullong wcstoull(wstring_t, +wstring_t*, int);
497
498int wcwidth(wchar_t);
499int wcswidth(wstring2_t, ulong);
500
501wstring_t wmemchr(wstring3_t, wchar_t, ulong);
502int wmemcmp(wstring3_t, wstring3_t, ulong);
503int wctob(wint_t);
504wstring3_t wmemcpy(addr, wstring3_t, ulong);
505wstring3_t wmemmove(addr, wstring3_t, ulong);
506wstring3_t wmemset(addr, wchar_t, ulong);
507
508# sys/wait.h
509int wait(addr);
510int waitpid(int,addr,int);
511
512# other symbols not included above
513long a64l(string);
514string l64a(long);
515void abort();
516int abs(int);
517long labs(long);
518
519typedef mntent = struct(string, string, string, string, int, int);
520int addmntent(file, mntent*);
521int endmntent(file);
522int __endmntent(file);
523file setmntent(string,string);
524file __setmntent(string,string);
525mntent *getmntent(addr);
526mntent *getmntent_r(file, +mntent*, string, int);
527mntent *__getmntent_r(file, +mntent*, string, int);
528string hasmntopt(mntent*, string);
529