]> andersk Git - splint.git/blame - lib/linux.h
Committing Evans's update of man page to fix problems reported by ESR.
[splint.git] / lib / linux.h
CommitLineData
8fe44445 1/*
2** linux.h
3*/
4
5/*
6** Based on Linux Standard Base Specification 1.0.0
7** http://www.linuxbase.org/spec/gLSB/gLSB/libc-ddefs.html
8*/
9
10/*
11
12Data Definitions for libc
13
14dirent.h
15*/
16
17typedef struct __dirstream DIR;
18
19/* Not in LSB: based on RedHat 7.0: */
20
21struct 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} ;
33
34/*@i43 struct dirent not in LSB spec
35 why doesn't alphasort64 use struct dirent64's?
36*/
37
38int acct (/*@null@*/ const char *filename)
39 /*:statusreturn@*/
40 /*@modifies systemState@*/ ;
41
42int alphasort (const struct dirent **a, const struct dirent **b) /*@*/ ;
43int alphasort64(const struct dirent **a, const struct dirent **b) /*@*/ ;
44
45/*
46ftw.h
47*/
48
49typedef int (*__ftw_func_t) (char *__filename, struct stat * __status,
50 int __flag);
51
52typedef int (*__ftw64_func_t) (char *__filename, struct stat64 * __status,
53 int __flag);
54
55typedef int (*__nftw_func_t) (char *__filename, struct stat * __status,
56 int __flag, struct FTW * __info);
57
58typedef int (*__nftw64_func_t) (char *__filename, struct stat64 * __status,
59 int __flag, struct FTW * __info);
60
61/*
62glob.h
63*/
64
65typedef struct
66{
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) ();
76}
77glob_t;
78
79typedef struct
80{
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) ();
90}
91glob64_t;
92
93/*
94grp.h
95*/
96
97struct group
98{
99 char *gr_name;
100 char *gr_passwd;
101 __gid_t gr_gid;
102 char **gr_mem;
103}
104;
105
106/*
107iconv.h
108*/
109
110typedef void *iconv_t;
111
112/*
113inttypes.h
114*/
115
116typedef lldiv_t imaxdiv_t;
117
118typedef long long intmax_t;
119
120typedef unsigned long long uintmax_t;
121
122/*
123locale.h
124*/
125
126struct lconv
127{
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;
146}
147;
148
149/*
150nl_types.h
151*/
152
153typedef void *nl_catd;
154
155typedef int nl_item;
156
157/*
158pwd.h
159*/
160
161struct passwd
162{
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;
170}
171;
172
173/*
174regex.h
175*/
176
177typedef unsigned long reg_syntax_t;
178
179typedef struct re_pattern_buffer
180{
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;
195}
196regex_t;
197
198typedef int regoff_t;
199
200typedef struct
201{
202 regoff_t rm_so;
203 regoff_t rm_eo;
204}
205regmatch_t;
206
207/*
208search.h
209*/
210
211typedef enum
212{
213 FIND,
214 ENTER
215}
216ACTION;
217
218typedef enum
219{
220 preorder,
221 postorder,
222 endorder,
223 leaf
224}
225VISIT;
226
227typedef struct entry
228{
229 char *key;
230 void *data;
231}
232ENTRY;
233
234typedef void (*__action_fn_t) (void *__nodep, VISIT __value, int __level);
235
236/*
237setjmp.h
238*/
239
240typedef int __jmp_buf;
241
242typedef struct __jmp_buf_tag
243{
244 __jmp_buf __jmpbuf;
245 int __mask_was_saved;
246 __sigset_t __saved_mask;
247}
248jmp_buf;
249
250typedef jmp_buf sigjmp_buf;
251
252/*
253signal.h
254*/
255
256typedef union sigval
257{
258 int sival_int;
259 void *sival_ptr;
260}
261sigval_t;
262
263typedef void (*__sighandler_t) ();
264
265struct sigevent
266{
267 sigval_t sigev_value;
268 int sigev_signo;
269 int sigev_notify;
270}
271;
272
273typedef struct
274{
275 unsigned long __val[1];
276}
277__sigset_t;
278
279typedef __sigset_t sigset_t;
280
281struct sigaction;
282
283typedef struct
284{
285 int si_band;
286 int si_fd;
287 struct _sifields;
288 struct _sigpoll;
289}
290siginfo_t;
291
292struct sigaltstack
293{
294 void *ss_sp;
295 int ss_flags;
296 size_t ss_size;
297}
298;
299
300struct sigstack
301{
302 void *ss_sp;
303 int ss_onstack;
304}
305;
306
307/*
308stdio.h
309*/
310
311typedef struct _IO_FILE FILE;
312
313typedef __off_t fpos_t;
314
315typedef __off64_t fpos64_t;
316
317/*
318stdlib.h
319*/
320
321typedef struct
322{
323 long long quot;
324 long long rem;
325}
326lldiv_t;
327
328typedef struct
329{
330 int quot;
331 int rem;
332}
333div_t;
334
335typedef struct
336{
337 long quot;
338 long rem;
339}
340ldiv_t;
341
342typedef int (*__compar_fn_t) ();
343
344/*
345sys/sem.h
346*/
347
348struct sembuf
349{
350 short sem_num;
351 short sem_op;
352 short sem_flg;
353}
354;
355
356/*
357sys/socket.h
358*/
359
360typedef unsigned short sa_family_t;
361
362typedef unsigned int socklen_t;
363
364struct sockaddr
365{
366 sa_family_t sa_family;
367 char sa_data[1];
368}
369;
370
371struct msghdr
372{
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;
380}
381;
382
383/*
384sys/times.h
385*/
386
387struct tms
388{
389 clock_t tms_utime;
390 clock_t tms_stime;
391 clock_t tms_cutime;
392 clock_t tms_cstime;
393}
394;
395
396/*
397sys/utsname.h
398*/
399
400struct utsname
401{
402 char sysname[1];
403 char nodename[1];
404 char release[1];
405 char version[1];
406 char machine[1];
407 char __domainname[1];
408}
409;
410
411/*
412sys/wait.h
413*/
414
415typedef enum
416{
417 P_ALL,
418 P_PID,
419 P_PGID
420}
421idtype_t;
422
423/*
424time.h
425*/
426
427typedef long __clock_t;
428
429struct timespec
430{
431 long tv_sec;
432 long tv_nsec;
433}
434;
435
436struct tm
437{
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;
449}
450;
451
452typedef __clock_t clock_t;
453
454typedef __time_t time_t;
455
456int 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@*/ ;
460
461/*
462unistd.h
463*/
464
465typedef __ssize_t ssize_t;
466
467typedef __pid_t pid_t;
468
469typedef __off_t off_t;
470
471extern /*@observer@*/ /*@nullterminated@*/ /*@null@*/
472char *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
476*/
477
478
479/*
480utime.h
481*/
482
483struct utimbuf
484{
485 __time_t actime;
486 __time_t modtime;
487}
488;
489
490/*
491wchar.h
492*/
493
494typedef long wchar_t;
495
496typedef unsigned int wint_t;
497
498typedef struct
499{
500 int count;
501 wint_t value;
502}
503mbstate_t;
504
505/*
506wctype.h
507*/
508
509typedef unsigned long wctype_t;
510
511typedef __int32_t *wctrans_t;
512
513/*
514wordexp.h
515*/
516
517typedef struct
518{
519 int we_wordc;
520 char **we_wordv;
521 int we_offs;
522}
523wordexp_t;
524
525/*
526timex.h
527*/
528
529struct 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 */
541
542};
543
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@*/
552
553int 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@*/ ;
557
558/*
559termios.h
560*/
561
562typedef unsigned char cc_t;
563typedef unsigned int speed_t;
564typedef unsigned int tcflag_t;
565
566struct termios
567{
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 */
573};
574
575int cfmakeraw (/*@out@*/ struct termios *termios_p)
576 /*:statusreturn@*/ ;
577
578int cfsetspeed(struct termios *t, speedt speed)
579 /*:statusreturn@*/ ;
580
581/*
582** Built in
583*/
584
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@*/;
This page took 0.924918 seconds and 5 git commands to generate.