Update build to fix in-place builds.
[splint-patched.git] / lib / linux.h
blob9b6e9ab308d7cdcf225b9b5c6f8948e531c52368
1 /*
2 ** linux.h
3 */
5 /*
6 ** Based on Linux Standard Base Specification 1.0.0
7 ** http://www.linuxbase.org/spec/gLSB/gLSB/libc-ddefs.html
8 */
12 Data Definitions for libc
14 dirent.h
17 typedef struct __dirstream DIR;
19 /* Not in LSB: based on RedHat 7.0: */
21 struct dirent {
22 #ifndef __USE_FILE_OFFSET64
23 __ino_t d_ino;
24 __off_t d_off;
25 #else
26 __ino64_t d_ino;
27 __off64_t d_off;
28 #endif
29 unsigned short int d_reclen;
30 unsigned char d_type;
31 char d_name[256]; /* We must not include limits.h! */
32 } ;
34 /*@i43 struct dirent not in LSB spec
35 why doesn't alphasort64 use struct dirent64's?
38 int acct (/*@null@*/ const char *filename)
39 /*:statusreturn@*/
40 /*@modifies systemState@*/ ;
42 int alphasort (const struct dirent **a, const struct dirent **b) /*@*/ ;
43 int alphasort64(const struct dirent **a, const struct dirent **b) /*@*/ ;
46 ftw.h
49 typedef int (*__ftw_func_t) (char *__filename, struct stat * __status,
50 int __flag);
52 typedef int (*__ftw64_func_t) (char *__filename, struct stat64 * __status,
53 int __flag);
55 typedef int (*__nftw_func_t) (char *__filename, struct stat * __status,
56 int __flag, struct FTW * __info);
58 typedef int (*__nftw64_func_t) (char *__filename, struct stat64 * __status,
59 int __flag, struct FTW * __info);
61 /*
62 glob.h
65 typedef struct
67 __size_t gl_pathc;
68 char **gl_pathv;
69 __size_t gl_offs;
70 int gl_flags;
71 void (*gl_closedir) ();
72 struct dirent64 *(*gl_readdir) ();
73 void *(*gl_opendir) ();
74 int (*gl_lstat) ();
75 int (*gl_stat) ();
77 glob_t;
79 typedef struct
81 __size_t gl_pathc;
82 char **gl_pathv;
83 __size_t gl_offs;
84 int gl_flags;
85 void (*gl_closedir) ();
86 struct dirent64 *(*gl_readdir) ();
87 void *(*gl_opendir) ();
88 int (*gl_lstat) ();
89 int (*gl_stat) ();
91 glob64_t;
94 grp.h
97 struct group
99 char *gr_name;
100 char *gr_passwd;
101 __gid_t gr_gid;
102 char **gr_mem;
107 iconv.h
110 typedef void *iconv_t;
113 inttypes.h
116 typedef lldiv_t imaxdiv_t;
118 typedef long long intmax_t;
120 typedef unsigned long long uintmax_t;
123 locale.h
126 struct lconv
128 char *decimal_point;
129 char *thousands_sep;
130 char *grouping;
131 char *int_curr_symbol;
132 char *currency_symbol;
133 char *mon_decimal_point;
134 char *mon_thousands_sep;
135 char *mon_grouping;
136 char *positive_sign;
137 char *negative_sign;
138 char int_frac_digits;
139 char frac_digits;
140 char p_cs_precedes;
141 char p_sep_by_space;
142 char n_cs_precedes;
143 char n_sep_by_space;
144 char p_sign_posn;
145 char n_sign_posn;
150 nl_types.h
153 typedef void *nl_catd;
155 typedef int nl_item;
158 pwd.h
161 struct passwd
163 char *pw_name;
164 char *pw_passwd;
165 __uid_t pw_uid;
166 __gid_t pw_gid;
167 char *pw_gecos;
168 char *pw_dir;
169 char *pw_shell;
174 regex.h
177 typedef unsigned long reg_syntax_t;
179 typedef struct re_pattern_buffer
181 unsigned char *buffer;
182 unsigned long allocated;
183 unsigned long used;
184 reg_syntax_t syntax;
185 char *fastmap;
186 char *translate;
187 size_t re_nsub;
188 unsigned int can_be_null;
189 unsigned int regs_allocated;
190 unsigned int fastmap_accurate;
191 unsigned int no_sub;
192 unsigned int not_bol;
193 unsigned int not_eol;
194 unsigned int newline_anchor;
196 regex_t;
198 typedef int regoff_t;
200 typedef struct
202 regoff_t rm_so;
203 regoff_t rm_eo;
205 regmatch_t;
208 search.h
211 typedef enum
213 FIND,
214 ENTER
216 ACTION;
218 typedef enum
220 preorder,
221 postorder,
222 endorder,
223 leaf
225 VISIT;
227 typedef struct entry
229 char *key;
230 void *data;
232 ENTRY;
234 typedef void (*__action_fn_t) (void *__nodep, VISIT __value, int __level);
237 setjmp.h
240 typedef int __jmp_buf;
242 typedef struct __jmp_buf_tag
244 __jmp_buf __jmpbuf;
245 int __mask_was_saved;
246 __sigset_t __saved_mask;
248 jmp_buf;
250 typedef jmp_buf sigjmp_buf;
253 signal.h
256 typedef union sigval
258 int sival_int;
259 void *sival_ptr;
261 sigval_t;
263 typedef void (*__sighandler_t) ();
265 struct sigevent
267 sigval_t sigev_value;
268 int sigev_signo;
269 int sigev_notify;
273 typedef struct
275 unsigned long __val[1];
277 __sigset_t;
279 typedef __sigset_t sigset_t;
281 struct sigaction;
283 typedef struct
285 int si_band;
286 int si_fd;
287 struct _sifields;
288 struct _sigpoll;
290 siginfo_t;
292 struct sigaltstack
294 void *ss_sp;
295 int ss_flags;
296 size_t ss_size;
300 struct sigstack
302 void *ss_sp;
303 int ss_onstack;
308 stdio.h
311 typedef struct _IO_FILE FILE;
313 typedef __off_t fpos_t;
315 typedef __off64_t fpos64_t;
318 stdlib.h
321 typedef struct
323 long long quot;
324 long long rem;
326 lldiv_t;
328 typedef struct
330 int quot;
331 int rem;
333 div_t;
335 typedef struct
337 long quot;
338 long rem;
340 ldiv_t;
342 typedef int (*__compar_fn_t) ();
345 sys/sem.h
348 struct sembuf
350 short sem_num;
351 short sem_op;
352 short sem_flg;
357 sys/socket.h
360 typedef unsigned short sa_family_t;
362 typedef unsigned int socklen_t;
364 struct sockaddr
366 sa_family_t sa_family;
367 char sa_data[1];
371 struct msghdr
373 void *msg_name;
374 socklen_t msg_namelen;
375 struct iovec *msg_iov;
376 size_t msg_iovlen;
377 void *msg_control;
378 size_t msg_controllen;
379 int msg_flags;
384 sys/times.h
387 struct tms
389 clock_t tms_utime;
390 clock_t tms_stime;
391 clock_t tms_cutime;
392 clock_t tms_cstime;
397 sys/utsname.h
400 struct utsname
402 char sysname[1];
403 char nodename[1];
404 char release[1];
405 char version[1];
406 char machine[1];
407 char __domainname[1];
412 sys/wait.h
415 typedef enum
417 P_ALL,
418 P_PID,
419 P_PGID
421 idtype_t;
424 time.h
427 typedef long __clock_t;
429 struct timespec
431 long tv_sec;
432 long tv_nsec;
436 struct tm
438 int tm_sec;
439 int tm_min;
440 int tm_hour;
441 int tm_mday;
442 int tm_mon;
443 int tm_year;
444 int tm_wday;
445 int tm_yday;
446 int tm_isdst;
447 long __tm_gmtoff;
448 char *__tm_zone;
452 typedef __clock_t clock_t;
454 typedef __time_t time_t;
456 int adjtime (/*@notnull@*/ const struct timeval *delta, /*@null@*/ struct timeval *olddelta)
457 /*@warn superuser "Only super-user processes may call adjtime."@*/
458 /*:statusreturn@*/
459 /*@modifies systemState@*/ ;
462 unistd.h
465 typedef __ssize_t ssize_t;
467 typedef __pid_t pid_t;
469 typedef __off_t off_t;
471 extern /*@observer@*/ /*@nullterminated@*/ /*@null@*/
472 char *bindtextdomain (/*@null@*/ /*@nullterminated@*/ const char *domainname,
473 /*@null@*/ /*@nullterminated@*/ const char *dirname) /*@*/ ;
474 /* LSB doesn't specify: taken from
475 http://www.hgmp.mrc.ac.uk/cgi-bin/man.cgi?section=3C&topic=bindtextdomain
480 utime.h
483 struct utimbuf
485 __time_t actime;
486 __time_t modtime;
491 wchar.h
494 typedef long wchar_t;
496 typedef unsigned int wint_t;
498 typedef struct
500 int count;
501 wint_t value;
503 mbstate_t;
506 wctype.h
509 typedef unsigned long wctype_t;
511 typedef __int32_t *wctrans_t;
514 wordexp.h
517 typedef struct
519 int we_wordc;
520 char **we_wordv;
521 int we_offs;
523 wordexp_t;
526 timex.h
529 struct timex {
530 int modes; /* mode selector */
531 long offset; /* time offset (usec) */
532 long freq; /* frequency offset (scaled ppm) */
533 long maxerror; /* maximum error (usec) */
534 long esterror; /* estimated error (usec) */
535 int status; /* clock command/status */
536 long constant; /* pll time constant */
537 long precision; /* clock precision (usec) (read only) */
538 long tolerance; /* clock frequency tolerance (ppm) (read only) */
539 struct timeval time; /* current time (read only) */
540 long tick; /* usecs between clock ticks */
544 /*@constant int ADJ_OFFSET@*/
545 /*@constant int ADJ_FREQUENCY@*/
546 /*@constant int ADJ_MAXERROR@*/
547 /*@constant int ADJ_ESTERROR@*/
548 /*@constant int ADJ_STATUS@*/
549 /*@constant int ADJ_TIMECONST@*/
550 /*@constant int ADJ_TICK@*/
551 /*@constant int ADJ_OFFSET_SINGLESHOT@*/
553 int adjtimex (/*@notnull@*/ struct timex *buf)
554 /*@warn superuser "Only super-user processes may call adjtimex unless the modes field is 0."@*/
555 /*:statusreturn@*/
556 /*@modifies systemState@*/ ;
559 termios.h
562 typedef unsigned char cc_t;
563 typedef unsigned int speed_t;
564 typedef unsigned int tcflag_t;
566 struct termios
568 tcflag_t c_iflag; /* input mode flags */
569 tcflag_t c_oflag; /* output mode flags */
570 tcflag_t c_cflag; /* control mode flags */
571 tcflag_t c_lflag; /* local mode flags */
572 cc_t c_cc[NCCS]; /* control characters */
575 int cfmakeraw (/*@out@*/ struct termios *termios_p)
576 /*:statusreturn@*/ ;
578 int cfsetspeed(struct termios *t, speedt speed)
579 /*:statusreturn@*/ ;
582 ** Built in
585 /*@exits@*/ void __assert_fail (/*@notnull@*/ const char *assertion,
586 /*@notnull@*/ const char *file,
587 unsigned int line,
588 /*@null@*/ const char *function)
589 /*@modifies stderr@*/;