]> andersk Git - splint.git/blame - lib/unix.h
Update test results.
[splint.git] / lib / unix.h
CommitLineData
885824d3 1/*
2** unix.h
3*/
4
5/*@-nextlinemacros@*/
6
345671f3 7/*
8** sys/types.h
9**
10** evans - 2001-08-27: from http://www.opengroup.org/onlinepubs/007908799/xsh/systypes.h.html
11*/
12
13typedef /*@integraltype@*/ blkcnt_t;
14typedef /*@integraltype@*/ blksize_t;
8fe44445 15
16/*@-redef@*/ /* These are also defined by ansi.h: */
345671f3 17typedef /*@integraltype@*/ clock_t;
345671f3 18typedef /*@integraltype@*/ dev_t;
345671f3 19typedef /*@integraltype@*/ gid_t;
345671f3 20typedef /*@unsignedintegraltype@*/ ino_t;
345671f3 21typedef /*@integraltype@*/ mode_t;
22typedef /*@integraltype@*/ nlink_t;
23typedef /*@integraltype@*/ off_t;
24typedef /*@integraltype@*/ pid_t;
8fe44445 25typedef /*@integraltype@*/ time_t;
26typedef /*@integraltype@*/ uid_t;
27
28/*@=redef@*/
29
30typedef /*@integraltype@*/ clockid_t;
31typedef /*@unsignedintegraltype@*/ fsblkcnt_t;
32typedef /*@unsignedintegraltype@*/ fsfilcnt_t;
33typedef /*@integraltype@*/ id_t;
34
35typedef /*@integraltype@*/ key_t;
345671f3 36typedef /*@integraltype@*/ pthread_attr_t;
37typedef /*@integraltype@*/ pthread_cond_t;
38typedef /*@integraltype@*/ pthread_condattr_t;
39typedef /*@integraltype@*/ pthread_key_t;
40typedef /*@integraltype@*/ pthread_mutex_t;
41typedef /*@integraltype@*/ pthread_mutexattr_t;
42typedef /*@integraltype@*/ pthread_once_t;
43typedef /*@integraltype@*/ pthread_rwlock_t;
44typedef /*@integraltype@*/ pthread_rwlockattr_t;
45typedef /*@integraltype@*/ pthread_t;
46typedef /*@signedintegraltype@*/ suseconds_t;
345671f3 47typedef /*@integraltype@*/ timer_t;
345671f3 48typedef /*@unsignedintegraltype@*/ useconds_t;
49
885824d3 50/*
51** Extra stuff in some unixen, not in posix.
52*/
53
8fe44445 54extern /*@unchecked@*/ int signgam;
885824d3 55
8fe44445 56/*@-redef@*/ /* Defined by ansi: */
885824d3 57typedef /*@integraltype@*/ clockid_t;
8fe44445 58/*@=redef@*/
885824d3 59
60extern void bcopy (char *b1, /*@out@*/ char *b2, int length)
61 /*@modifies *b2@*/ ; /* Yes, the second parameter is the out param! */
62
63extern int /*@alt lltX_bool@*/ bcmp (char *b1, char *b2, int length) /*@*/ ;
64 /* Return value is NOT like strcmp! */
65
66extern void bzero (/*@out@*/ char *b1, int length) /*@modifies *b1@*/ ;
67extern int ffs (int i) /*@*/ ;
68extern int symlink (char *name1, char *name2) /*@modifies fileSystem@*/ ;
69
70extern int
71 setvbuf_unlocked (FILE *stream, /*@null@*/ /*@exposed@*/ char *buf,
72 int mode, size_t size)
73 /*@modifies internalState@*/ ;
74
75extern void
76 setbuffer (FILE *stream, /*@null@*/ /*@exposed@*/ char *buf, int size)
77 /*@modifies internalState@*/ ;
78
79extern void setlinebuf (FILE *stream) /*@modifies internalState@*/ ;
80
81extern int strerror_r (int errnum, /*@out@*/ char *strerrbuf, int buflen)
82 /*@modifies strerrbuf@*/ ;
83
84extern size_t
85 fread_unlocked (/*@out@*/ void *ptr, size_t size, size_t nitems,
86 FILE *stream)
87 /*@modifies *stream, *ptr;@*/ ;
88
89extern size_t
90 fwrite_unlocked (void *pointer, size_t size, size_t num_items, FILE *stream)
91 /*@modifies *stream;@*/ ;
92
885824d3 93extern void /*@alt void * @*/
94 memccpy (/*@returned@*/ /*@out@*/ void *s1,
95 /*@unique@*/ void *s2, int c, size_t n)
96 /*@modifies *s1@*/ ;
97
98extern int strcasecmp (char *s1, char *s2) /*@*/ ;
99extern int strncasecmp (char *s1, char *s2, int n) /*@*/ ;
1d239d69 100extern /*@null@*/ /*@only@*/ char *strdup (char *s) /*@*/ ;
885824d3 101
885824d3 102extern /*@null@*/ /*@dependent@*/ char *
103 index (/*@returned@*/ char *s, char c) /*@*/ ;
104
105extern /*@null@*/ /*@dependent@*/ char *
106 rindex (/*@returned@*/ char *s, char c) /*@*/ ;
107
ce7034f0 108# if 0
109These are in ISO C99. Moved to standard.h:
110 extern double cbrt (double x) /*@modifies errno@*/ ;
111 extern double rint (double x) /*@*/ ;
112 extern double trunc (double x) /*@*/ ;
113# endif
885824d3 114
885824d3 115
116/*@constant int ENOTBLK@*/
117/*@constant int ETXTBSY@*/
118/*@constant int EWOULDBLOCK@*/
119/*@constant int EINPROGRESS@*/
120/*@constant int EALREADY@*/
121/*@constant int ENOTSOCK@*/
122/*@constant int EDESTADDRREQ@*/
123/*@constant int EMSGSIZE@*/
124/*@constant int EPROTOTYPE@*/
125/*@constant int ENOPROTOOPT@*/
126/*@constant int EPROTONOSUPPORT@*/
127/*@constant int ESOCKTNOSUPPORT@*/
128/*@constant int EOPNOTSUPP@*/
129/*@constant int EPFNOSUPPORT@*/
130/*@constant int EAFNOSUPPORT@*/
131/*@constant int EADDRINUSE@*/
132/*@constant int EADDRNOTAVAIL@*/
133/*@constant int ENETDOWN@*/
134/*@constant int ENETUNREACH@*/
135/*@constant int ENETRESET@*/
136/*@constant int ECONNABORTED@*/
137/*@constant int ECONNRESET@*/
138/*@constant int ENOBUFS@*/
139/*@constant int EISCONN@*/
140/*@constant int ENOTCONN@*/
141/*@constant int ESHUTDOWN@*/
142/*@constant int ETOOMANYREFS@*/
143/*@constant int ETIMEDOUT@*/
144/*@constant int ECONNREFUSED@*/
145/*@constant int ENAMETOOLONG@*/
146/*@constant int EHOSTDOWN@*/
147/*@constant int EHOSTUNREACH@*/
148/*@constant int ENOTEMPTY@*/
149/*@constant int EPROCLIM@*/
150/*@constant int EUSERS@*/
151/*@constant int EDQUOT@*/
152/*@constant int ESTALE@*/
153/*@constant int EREMOTE@*/
154/*@constant int ENOMSG@*/
155/*@constant int EIDRM@*/
156/*@constant int EALIGN@*/
157/*@constant int EDEADLK@*/
158/*@constant int ENOLCK@*/
159/*@constant int ENOSYS@*/
160/*@constant int EACTIVE@*/
161/*@constant int ENOACTIVE@*/
162/*@constant int ENORESOURCES@*/
163/*@constant int ENOSYSTEM@*/
164/*@constant int ENODUST@*/
165/*@constant int EDUPNOCONN@*/
166/*@constant int EDUPNODISCONN@*/
167/*@constant int EDUPNOTCNTD@*/
168/*@constant int EDUPNOTIDLE@*/
169/*@constant int EDUPNOTWAIT@*/
170/*@constant int EDUPNOTRUN@*/
171/*@constant int EDUPBADOPCODE@*/
172/*@constant int EDUPINTRANSIT@*/
173/*@constant int EDUPTOOMANYCPUS@*/
174/*@constant int ELOOP@*/
175
176/*@constant int LOCK_MAX@*/
177/*@constant int FCHR_MAX@*/
178/*@constant int USI_MAX@*/
179/*@constant int WORD_BIT@*/
180/*@constant int LONG_BIT@*/
4aadc959 181
86d93ed3 182/*@-incondefs@*/ /* some constant are also declared in posix.h*/
183
184/*@constant long NAME_MAX@*/
185
885824d3 186/*@constant long NGROUPS_MAX@*/
4aadc959 187
885824d3 188/*@constant long MAX_CANON@*/
189/*@constant int MAX_CHAR@*/
190/*@constant long OPEN_MAX@*/
191/*@constant int PASS_MAX@*/
4aadc959 192
885824d3 193/*@constant int PID_MAX@*/
194/*@constant int SYSPID_MAX@*/
86d93ed3 195/*@constant long PIPE_BUF@*/
196/*@=incondefs@*/
885824d3 197/*@constant int PIPE_MAX@*/
198/*@constant int PROC_MAX@*/
199/*@constant int STD_BLK@*/
200/*@constant int SYS_NMLN@*/
201/*@constant int SYS_OPEN@*/
202/*@constant int NZERO@*/
203/*@constant int UID_MAX@*/
204/*@constant long MB_LEN_MAX@*/
205/*@constant int NL_ARGMAX@*/
206/*@constant int NL_MSGMAX@*/
207/*@constant int NL_NMAX@*/
208/*@constant int NL_SETMAX@*/
209/*@constant int NL_TEXTMAX@*/
210/*@constant int NL_LBLMAX@*/
211/*@constant int NL_LANGMAX @*/
212
213/*@constant double M_E@*/
214/*@constant double M_LOG2E@*/
215/*@constant double M_LOG10E@*/
216/*@constant double M_LN2@*/
217/*@constant double M_LN10@*/
218/*@constant double M_PI@*/
219/*@constant double M_PI_2@*/
220/*@constant double M_PI_4@*/
221/*@constant double M_1_PI@*/
222/*@constant double M_2_PI@*/
223/*@constant double M_2_SQRTPI@*/
224/*@constant double M_SQRT2@*/
225/*@constant double M_SQRT1_2@*/
226
227/*@constant double MAXFLOAT@*/
228/*@constant double HUGE@*/
229
230/*@constant int DOMAIN@*/
231/*@constant int SING@*/
232/*@constant int OVERFLOW@*/
233/*@constant int UNDERFLOW@*/
234/*@constant int TLOSS@*/
235/*@constant int PLOSS@*/
236
237extern /*@unchecked@*/ int daylight;
238extern /*@unchecked@*/ long timezone;
239extern /*@unchecked@*/ char *tzname[];
240
241/*@-incondefs@*/
242extern void tzset(void) /*@modifies daylight, timezone, tzname@*/ ;
243/*@=incondefs@*/
244
8fe44445 245/*@-redef@*/ /* Defined by ansi: */
246typedef /*@integraltype@*/ key_t;
247/*@-incondefs@*/ typedef long timer_t; /*@=incondefs@*/
248/*@=redef@*/
249
885824d3 250typedef unsigned char uchar_t;
251typedef unsigned short ushort_t;
252typedef unsigned int uint_t;
253typedef unsigned long ulong_t;
254typedef volatile unsigned char vuchar_t;
255typedef volatile unsigned short vushort_t;
256typedef volatile unsigned int vuint_t;
257typedef volatile unsigned long vulong_t;
258typedef long label_t;
259typedef int level_t;
260typedef /*@integraltype@*/ daddr_t;
261typedef char *caddr_t;
262typedef long *qaddr_t;
263typedef char *addr_t;
264typedef long physadr_t;
265typedef short cnt_t;
266typedef int chan_t;
267typedef unsigned long rlim_t;
268typedef int paddr_t;
885824d3 269typedef void *mid_t;
270typedef char slab_t[12];
271typedef ulong_t shmatt_t;
272typedef ulong_t msgqnum_t;
273typedef ulong_t msglen_t;
885824d3 274typedef uchar_t uchar;
275typedef ushort_t ushort;
276typedef uint_t uint;
277typedef ulong_t ulong;
278typedef uchar_t u_char;
279typedef ushort_t u_short;
280typedef uint_t u_int;
281typedef ulong_t u_long;
282typedef vuchar_t vu_char;
283typedef vushort_t vu_short;
284typedef vuint_t vu_int;
285typedef vulong_t vu_long;
286typedef long swblk_t;
287typedef u_long fixpt_t;
288typedef long segsz_t;
289typedef /*@abstract@*/ fd_set;
290
885824d3 291int ioctl (int d, int /*@alt long@*/ request, /*@out@*/ void *arg)
292 /*@modifies *arg, errno@*/ ; /* depends on request! */
293
885824d3 294pid_t vfork (void) /*@modifies fileSystem@*/ ;
295
140c27a8 296/*
297** sys/uio.h
298*/
885824d3 299
15b3d2b2 300struct iovec {
2a3f24b8 301 /*@dependent@*/ void *iov_base;
140c27a8 302 size_t iov_len; /*: maxSet(iov_base) = iov_len */
885824d3 303};
304
140c27a8 305/* from limits.h */
885824d3 306/*@constant int UIO_MAXIOV@*/ /* BSD */
307/*@constant int IOV_MAX@*/ /* supposedly SVR4 */
308
140c27a8 309ssize_t readv (int fd, const struct iovec *iov, int iovcnt)
310 /*@modifies iov->iov_base, fileSystem, errno@*/;
885824d3 311
140c27a8 312ssize_t writev (int fd, const struct iovec *iov, int iovcnt)
313 /*@modifies errno@*/;
885824d3 314
315/*________________________________________________________________________
316 * poll.h
317 */
318
319 struct poll {
320 int fd;
321 short events;
322 short revents;
323};
324
325/*@constant short POLLIN@*/
326/*@constant short POLLRDNORM@*/
327/*@constant short POLLRDBAND@*/
328/*@constant short POLLPRI@*/
329/*@constant short POLLOUT@*/
330/*@constant short POLLWRNORM@*/
331/*@constant short POLLWRBAND@*/
332/*@constant short POLLERR@*/
333/*@constant short POLLHUP@*/
334/*@constant short POLLNVAL@*/
335
336extern int poll (struct poll pollfd[], unsigned long nfds, int timeout)
337 /*@modifies pollfd[].revents, errno@*/ ;
338
339/*
340** free does not take null
341*/
342
343/*@-incondefs@*/
344extern void free (/*@notnull@*/ /*@out@*/ /*@only@*/ void *p) /*@modifies *p@*/ ;
345/*@=incondefs@*/
346
347/*________________________________________________________________________
348 * sys/socket.h
349 */
350
140c27a8 351
352
353
885824d3 354/*@constant int SOCK_RDM@*/
140c27a8 355
356
357
358
359
360
361
885824d3 362/*@constant int SO_USELOOPBACK@*/
140c27a8 363
364
885824d3 365/*@constant int SO_REUSEPORT@*/
140c27a8 366
367
368
369
370
371
372
373
374
375
885824d3 376/*@constant int AF_LOCAL@*/
140c27a8 377
378
885824d3 379/*@constant int AF_IMPLINK@*/
380/*@constant int AF_PUP@*/
381/*@constant int AF_CHAOS@*/
382/*@constant int AF_NS@*/
383/*@constant int AF_ISO@*/
384/*@constant int AF_OSI@*/
385/*@constant int AF_ECMA@*/
386/*@constant int AF_DATAKIT@*/
387/*@constant int AF_CCITT@*/
388/*@constant int AF_SNA@*/
389/*@constant int AF_DECnet@*/
390/*@constant int AF_DLI@*/
391/*@constant int AF_LAT@*/
392/*@constant int AF_HYLINK@*/
393/*@constant int AF_APPLETALK@*/
394/*@constant int AF_ROUTE@*/
395/*@constant int AF_LINK@*/
396/*@constant int pseudo_AF_XTP@*/
397/*@constant int AF_COIP@*/
398/*@constant int AF_CNT@*/
399/*@constant int pseudo_AF_RTIP@*/
400/*@constant int AF_IPX@*/
401/*@constant int AF_SIP@*/
402/*@constant int pseudo_AF_PIP@*/
403/*@constant int AF_ISDN@*/
404/*@constant int AF_E164@*/
405/*@constant int AF_MAX@*/
140c27a8 406
407
408
409
410
411
885824d3 412/*@constant int MSG_DONTWAIT@*/
413/*@constant int MSG_EOF@*/
414/*@constant int MSG_COMPAT@*/
415/*@constant int PF_UNSPEC@*/
416/*@constant int PF_LOCAL@*/
417/*@constant int PF_UNIX@*/
418/*@constant int PF_INET@*/
419/*@constant int PF_IMPLINK@*/
420/*@constant int PF_PUP@*/
421/*@constant int PF_CHAOS@*/
422/*@constant int PF_NS@*/
423/*@constant int PF_ISO@*/
424/*@constant int PF_OSI@*/
425/*@constant int PF_ECMA@*/
426/*@constant int PF_DATAKIT@*/
427/*@constant int PF_CCITT@*/
428/*@constant int PF_SNA@*/
429/*@constant int PF_DECnet@*/
430/*@constant int PF_DLI@*/
431/*@constant int PF_LAT@*/
432/*@constant int PF_HYLINK@*/
433/*@constant int PF_APPLETALK@*/
434/*@constant int PF_ROUTE@*/
435/*@constant int PF_LINK@*/
436/*@constant int PF_XTP@*/
437/*@constant int PF_COIP@*/
438/*@constant int PF_CNT@*/
439/*@constant int PF_SIP@*/
440/*@constant int PF_IPX@*/
441/*@constant int PF_RTIP@*/
442/*@constant int PF_PIP@*/
443/*@constant int PF_ISDN@*/
444/*@constant int PF_MAX@*/
445/*@constant int NET_MAXID@*/
446/*@constant int NET_RT_DUMP@*/
447/*@constant int NET_RT_FLAGS@*/
448/*@constant int NET_RT_IFLIST@*/
449/*@constant int NET_RT_MAXID@*/
885824d3 450
eed3d8ac 451/*moved this to before socket.h to get splint to parse the header*/
452typedef /*@unsignedintegraltype@*/ sa_family_t;
453
140c27a8 454/*
455** sys/socket.h
456** (updated 26 May 2002)
457*/
458
459typedef /*@unsignedintegraltype@*/ socklen_t;
460
461struct sockaddr {
462 sa_family_t sa_family; /* address family */
463 char sa_data[]; /* variable length */
885824d3 464};
140c27a8 465
466struct sockaddr_storage {
467 sa_family_t ss_family;
468} ;
469
470struct msghdr {
2a3f24b8 471 /*@dependent@*/ void *msg_name;
140c27a8 472 socklen_t msg_namelen; /*: maxSet (msg_name) >= msg_namelen */
2a3f24b8 473 /*@dependent@*/ struct iovec *msg_iov; /* scatter/gather array */
140c27a8 474 int msg_iovlen; /* # elements in msg_iov */ /*: maxSet (msg_iov) >= msg_iovlen */
2a3f24b8 475 /*@dependent@*/ void *msg_control; /* ancillary data, see below */
140c27a8 476 socklen_t msg_controllen; /*: maxSet (msg_control) >= msg_controllen */
477 int msg_flags; /* flags on received message */
478} ;
479
480struct cmsghdr {
481 socklen_t cmsg_len; /* data byte count, including hdr */
482 int cmsg_level; /* originating protocol */
483 int cmsg_type; /* protocol-specific type */
484} ;
485
486/*@constant int SCM_RIGHTS@*/
487
488/*@exposed@*/ unsigned char *CMSG_DATA (/*@sef@*/ struct cmsghdr *) /*@*/ ;
489/*@null@*/ /*@exposed@*/ struct cmsghdr *CMSG_NXTHDR (struct msghdr *, struct cmsghdr *) /*@*/ ;
490/*@null@*/ /*@exposed@*/ struct cmsghdr *CMSG_FIRSTHDR (struct msghdr *) /*@*/ ;
491
492struct linger {
493 int l_onoff;
494 int l_linger;
885824d3 495};
496
140c27a8 497/*@constant int SOCK_DGRAM@*/
498/*@constant int SOCK_RAW@*/
499/*@constant int SOCK_SEQPACKET@*/
500/*@constant int SOCK_STREAM@*/
501
502/*@constant int SOL_SOCKET@*/
503
504/*@constant int SO_ACCEPTCONN@*/
505/*@constant int SO_BROADCAST@*/
506/*@constant int SO_DEBUG@*/
507/*@constant int SO_DONTROUTE@*/
508/*@constant int SO_ERROR@*/
509/*@constant int SO_KEEPALIVE@*/
510/*@constant int SO_LINGER@*/
511/*@constant int SO_OOBINLINE@*/
512/*@constant int SO_RCVBUF@*/
513/*@constant int SO_RCVLOWAT@*/
514/*@constant int SO_RCVTIMEO@*/
515/*@constant int SO_REUSEADDR@*/
516/*@constant int SO_SNDBUF@*/
517/*@constant int SO_SNDLOWAT@*/
518/*@constant int SO_SNDTIMEO@*/
519/*@constant int SO_TYPE@*/
520
521/*@constant int SOMAXCONN@*/
522
523/*@constant int MSG_CTRUNC@*/
524/*@constant int MSG_DONTROUTE@*/
525/*@constant int MSG_EOR@*/
526/*@constant int MSG_OOB@*/
527/*@constant int MSG_PEEK@*/
528/*@constant int MSG_TRUNC@*/
529/*@constant int MSG_WAITALL@*/
530
531/*@constant int AF_INET@*/
532/*@constant int AF_INET6@*/
533/*@constant int AF_UNIX@*/
534/*@constant int AF_UNSPEC@*/
535
536/*@constant int SHUT_RD@*/
537/*@constant int SHUT_RDWR@*/
538/*@constant int SHUT_WR@*/
539
540# if 0
541/*
542** These were in the old unix.h spec, but are not in SUS6
543*/
544
545struct sockproto {
546 u_short sp_family; /* address family */
547 u_short sp_protocol; /* protocol */
885824d3 548};
549
140c27a8 550# endif
885824d3 551
140c27a8 552int accept (int s, struct sockaddr *addr, int *addrlen)
553 /*@modifies *addrlen, errno@*/;
885824d3 554
140c27a8 555int bind (int s, const struct sockaddr *name, int namelen)
556 /*@modifies errno, fileSystem@*/;
885824d3 557
140c27a8 558int connect (int s, const struct sockaddr *name, int namelen)
559 /*@modifies errno, internalState@*/;
86d93ed3 560
2a3f24b8 561int getpeername (int s, /*@out@*/ struct sockaddr */*restrict*/ name, socklen_t */*restrict*/ namelen)
eed3d8ac 562 /*drl splint doesn't handle restrict yet*/
140c27a8 563 /*@modifies *name, *namelen, errno@*/;
564
86d93ed3 565#ifdef STRICT
885824d3 566
86d93ed3 567int getsockname (int s, /*@out@*/ struct sockaddr *address, socklen_t *address_len)
568 /*@i556@*/ /*: can't do this? requires maxSet(address) >= (*address_len) @*/
7272a1c1 569 /*@modifies *address, *address_len, errno@*/;
885824d3 570
86d93ed3 571#else
572int getsockname (int s, /*@out@*/ struct sockaddr *address, socklen_t /*@alt size_t@*/ *address_len)
155af98d 573 /*@i556@*/ /*: can't do this? requires maxSet(address) >= (*address_len) @*/
86d93ed3 574 /*@modifies *address, *address_len, errno@*/;
575
576#endif
577
7272a1c1 578int getsockopt (int s, int level, int optname, /*@out@*/ void *optval, size_t *optlen)
885824d3 579 /*@modifies *optval, *optlen, errno@*/;
580
581 extern int
582listen (int s, int backlog)
583 /*@modifies errno, internalState@*/;
584
585 extern ssize_t
586recv (int s, /*@out@*/ void *buf, size_t len, int flags)
587 /*@modifies *buf, errno@*/;
588
589 extern ssize_t
590recvfrom (int s, void *buf, size_t len, int flags, /*@null@*/ struct sockaddr *from, int *fromlen)
591 /*@modifies *buf, *from, *fromlen, errno@*/;
592
593 extern ssize_t
594recvmsg (int s, struct msghdr *msg, int flags)
595 /*@modifies msg->msg_iov->iov_base[], errno@*/;
596
597 extern ssize_t
598send (int s, const void *msg, size_t len, int flags)
599 /*@modifies errno@*/;
600
601 extern ssize_t
602sendto (int s, const void *msg, size_t len, int flags, const struct sockaddr *to, int tolen)
603 /*@modifies errno@*/;
604
605 extern ssize_t
606sendmsg (int s, const struct msghdr *msg, int flags)
607 /*@modifies errno@*/;
608
609 extern int
610setsockopt (int s, int level, int optname, const void *optval, int optlen)
611 /*@modifies internalState, errno@*/;
612
613 extern int
614shutdown (int s, int how)
615 /*@modifies errno@*/;
616
617 extern int
618socket (int domain, int type, int protocol)
619 /*@modifies errno@*/;
620
621 extern int
622socketpair (int d, int type, int protocol, /*@out@*/ int *sv)
623 /*@modifies errno@*/;
624
625/*@constant int BADSIG@*/
626/*@constant int SA_ONSTACK@*/
627/*@constant int SA_RESTART@*/
628/*@constant int SA_DISABLE@*/
629/*@constant int SIGBUS@*/
630/*@constant int SIGEMT@*/
631/*@constant int SIGINFO@*/
632/*@constant int SIGIO@*/
633/*@constant int SIGIOT@*/
634/*@constant int SIGPOLL@*/
635/*@constant int SIGPROF@*/
636/*@constant int SIGPWR@*/
637/*@constant int SIGSYS@*/
638/*@constant int SIGTRAP@*/
639/*@constant int SIGURG@*/
640/*@constant int SIGVTALRM@*/
641/*@constant int SIGWINCH@*/
642/*@constant int SIGXCPU@*/
643/*@constant int SIGXFSZ@*/
644
645extern void psignal (int sig, const char *msg)
646 /*@modifies fileSystem@*/;
647
885824d3 648 extern int
649setenv (const char *name, const char *value, int overwrite)
650 /*@globals environ@*/
651 /*@modifies *environ, errno@*/;
652
885824d3 653 extern void
654unsetenv (const char *name)
655 /*@globals environ@*/
656 /*@modifies *environ@*/;
657
658/*________________________________________________________________________
659 * sys/wait.h
660 */
661
662 extern int
663WCOREDUMP (int x)
664 /*@*/;
665
666 extern int
667W_EXITCODE (int ret, int sig)
668 /*@*/;
669
670 extern int
671W_STOPCODE (int sig)
672 /*@*/;
673
674/*@constant int WAIT_ANY@*/
675/*@constant int WAIT_MYPGRP@*/
676/*@constant int WSTOPPED@*/
677
678 extern pid_t
679wait3 (int *statloc, int options, /*@null@*/ /*@out@*/ struct rusage *rusage)
680 /*@modifies *statloc, *rusage, errno@*/;
681
682 extern pid_t
683wait4 (pid_t p, int *statloc, int opt, /*@null@*/ /*@out@*/ struct rusage *r)
684 /*@modifies *statloc, *r, errno@*/;
685
686struct timeval {
687 long tv_sec;
688 long tv_usec;
689} ;
690
691struct timespec {
692 long ts_sec;
693 long ts_nsec;
694} ;
695
696struct timezone {
697 int tz_minuteswest;
698 int tz_dsttime;
699} ;
700
701/*@constant int DST_NONE@*/
702/*@constant int DST_USA@*/
703/*@constant int DST_AUST@*/
704/*@constant int DST_WET@*/
705/*@constant int DST_MET@*/
706/*@constant int DST_EET@*/
707/*@constant int DST_CAN@*/
708
709/*@constant int ITIMER_PROF@*/
710/*@constant int ITIMER_REAL@*/
711/*@constant int ITIMER_VIRTUAL@*/
712
713 struct itimerval {
714 struct timeval it_interval;
715 struct timeval it_value;
716};
717
718 struct clockinfo {
719 int hz;
720 int tick;
721 int stathz;
722 int profhz;
723};
724
725 extern int
726adjtime (const struct timeval *delta, /*@null@*/ /*@out@*/ struct timeval *olddelta)
727 /*@modifies internalState, *olddelta, errno@*/;
728
729 extern int
730getitimer (int which, /*@out@*/ struct itimerval *value)
731 /*@modifies errno, *value*/;
732
733 extern int
734gettimeofday (/*@null@*/ /*@out@*/ struct timeval *tp, /*@null@*/ /*@out@*/ struct timezone *tzp)
735 /*@modifies *tp, *tzp, errno@*/;
736
737 extern int
738setitimer (int which, struct itimerval *val, /*@null@*/ /*@out@*/ struct itimerval *oval)
739 /*@modifies *oval, errno, internalState*/;
740
741 extern int
742settimeofday (const struct timeval *t, const struct timezone *z)
743 /*@modifies internalState, errno@*/;
744
745 extern int
746utimes (const char *file, /*@null@*/ const struct timeval *times)
747 /*@modifies fileSystem, errno*/;
748
749/*________________________________________________________________________
750 * sys/mman.h
751 */
752
753/*@constant int PROT_READ@*/
754/*@constant int PROT_WRITE@*/
755/*@constant int PROT_EXEC@*/
756/*@constant int MAP_SHARED@*/
757/*@constant int MAP_PRIVATE@*/
758/*@constant int MAP_COPY@*/
759/*@constant int MAP_FIXED@*/
760/*@constant int MAP_RENAME@*/
761/*@constant int MAP_NORESERVE@*/
762/*@constant int MAP_INHERIT@*/
763/*@constant int MAP_NOEXTEND@*/
764/*@constant int MAP_HASSEMAPHORE@*/
765/*@constant int MS_ASYNC@*/
766/*@constant int MS_INVALIDATE@*/
767/*@constant int MAP_FILE@*/
768/*@constant int MAP_ANON@*/
769/*@constant int MADV_NORMAL@*/
770/*@constant int MADV_RANDOM@*/
771/*@constant int MADV_SEQUENTIAL@*/
772/*@constant int MADV_WILLNEED@*/
773/*@constant int MADV_DONTNEED@*/
774
775 extern caddr_t
776mmap (/*@null@*/ /*@returned@*/ caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
777 /*@modifies addr@*/;
778
779 extern int
780madvise (caddr_t addr, int len, int behav)
781 /*@*/;
782
783 extern int
784mprotect (caddr_t addr, int len, int prot)
785 /*@*/;
786
787 extern int
345671f3 788 int munmap (/*@only@*/ caddr_t addr, size_t len)
789 /*@modifies fileSystem, *addr, errno @*/;
790
885824d3 791 extern int
792msync (caddr_t addr, int len, int flags)
793 /*@*/;
794
795 extern int
796mlock (caddr_t addr, size_t len)
797 /*@*/;
798
799 extern int
800munlock (caddr_t addr, size_t len)
801 /*@*/;
802
803
804/*________________________________________________________________________
805 * sys/ioctl.h
806 */
807
808 struct winsize {
809 unsigned short ws_row;
810 unsigned short ws_col;
811 unsigned short ws_xpixel;
812 unsigned short ws_ypixel;
813};
814
815/*@constant int TIOCMODG@*/
816/*@constant int TIOCMODS@*/
817/*@constant int TIOCM_LE@*/
818/*@constant int TIOCM_DTR@*/
819/*@constant int TIOCM_RTS@*/
820/*@constant int TIOCM_ST@*/
821/*@constant int TIOCM_SR@*/
822/*@constant int TIOCM_CTS@*/
823/*@constant int TIOCM_CAR@*/
824/*@constant int TIOCM_CD@*/
825/*@constant int TIOCM_RNG@*/
826/*@constant int TIOCM_RI@*/
827/*@constant int TIOCM_DSR@*/
828/*@constant int TIOCEXCL@*/
829/*@constant int TIOCNXCL@*/
830/*@constant int TIOCFLUSH@*/
831/*@constant int TIOCGETA@*/
832/*@constant int TIOCSETA@*/
833/*@constant int TIOCSETAW@*/
834/*@constant int TIOCSETAF@*/
835/*@constant int TIOCGETD@*/
836/*@constant int TIOCSETD@*/
837/*@constant int TIOCSBRK@*/
838/*@constant int TIOCCBRK@*/
839/*@constant int TIOCSDTR@*/
840/*@constant int TIOCCDTR@*/
841/*@constant int TIOCGPGRP@*/
842/*@constant int TIOCSPGRP@*/
843/*@constant int TIOCOUTQ@*/
844/*@constant int TIOCSTI@*/
845/*@constant int TIOCNOTTY@*/
846/*@constant int TIOCPKT@*/
847/*@constant int TIOCPKT_DATA@*/
848/*@constant int TIOCPKT_FLUSHREAD@*/
849/*@constant int TIOCPKT_FLUSHWRITE@*/
850/*@constant int TIOCPKT_STOP@*/
851/*@constant int TIOCPKT_START@*/
852/*@constant int TIOCPKT_NOSTOP@*/
853/*@constant int TIOCPKT_DOSTOP@*/
854/*@constant int TIOCPKT_IOCTL@*/
855/*@constant int TIOCSTOP@*/
856/*@constant int TIOCSTART@*/
857/*@constant int TIOCMSET@*/
858/*@constant int TIOCMBIS@*/
859/*@constant int TIOCMBIC@*/
860/*@constant int TIOCMGET@*/
861/*@constant int TIOCREMOTE@*/
862/*@constant int TIOCGWINSZ@*/
863/*@constant int TIOCSWINSZ@*/
864/*@constant int TIOCUCNTL@*/
865/*@constant int TIOCSTAT@*/
866/*@constant int TIOCCONS@*/
867/*@constant int TIOCSCTTY@*/
868/*@constant int TIOCEXT@*/
869/*@constant int TIOCSIG@*/
870/*@constant int TIOCDRAIN@*/
871/*@constant int TIOCMSDTRWAIT@*/
872/*@constant int TIOCMGDTRWAIT@*/
873/*@constant int TIOCTIMESTAMP@*/
874/*@constant int TIOCSDRAINWAIT@*/
875/*@constant int TIOCGDRAINWAIT@*/
876/*@constant int TTYDISC@*/
877/*@constant int TABLDISC@*/
878/*@constant int SLIPDISC@*/
879/*@constant int PPPDISC@*/
880
881/*@constant int MAXHOSTNAMELEN@*/
882
883 extern void
884FD_CLR (int n, fd_set *p)
885 /*@modifies *p@*/;
886
887 extern void
888FD_COPY (fd_set *f, /*@out@*/ fd_set *t)
889 /*@modifies *t@*/;
890
891 extern int /*@alt lltX_bool@*/
892FD_ISSET (int n, fd_set *p)
893 /*@*/;
894
895 extern void
896FD_SET (int n, fd_set *p)
897 /*@modifies *p@*/;
898
899 extern void
900FD_ZERO (fd_set /*@out@*/ *p)
901 /*@modifies *p@*/;
902
903 extern int
904fchdir (int fd)
905 /*@modifies internalState, errno@*/;
906
907 extern int
908fchown (int fd, uid_t owner, gid_t group)
909 /*@modifies errno, fileSystem@*/;
910
911 extern int
912fsync (int fd)
913 /*@modifies errno, fileSystem@*/;
914
915 extern int
916ftruncate (int fd, off_t length)
917 /*@modifies errno, fileSystem@*/;
918
b072092f 919int gethostname (/*@out@*/ char *address, size_t address_len)
920 /*:errorstatus@*/
921 /*@modifies address@*/ ;
885824d3 922
b072092f 923int initgroups (const char *name, int basegid)
924 /*@modifies internalState@*/;
885824d3 925
140c27a8 926int lchown (const char *path, uid_t owner, gid_t group)
927 /*@modifies errno, fileSystem@*/;
928
929int select (int mfd, fd_set /*@null@*/ *r, fd_set /*@null@*/ *w, fd_set /*@null@*/ *e, /*@null@*/ struct timeval *t)
930 /*@modifies *r, *w, *e, *t, errno@*/;
931 /* evans - 2002-05-26: added null for t, bug reported by Enrico Scholz */
932
933int setegid (gid_t egid)
934 /*@modifies errno, internalState@*/;
935
936int seteuid (uid_t euid)
937 /*@modifies errno, internalState@*/;
938
939int setgroups (int ngroups, const gid_t *gidset)
940 /*@modifies errno, internalState@*/;
941
942int setregid (gid_t rgid, gid_t egid)
943 /*@modifies errno, internalState@*/;
944
945int setreuid (gid_t ruid, gid_t euid)
946 /*@modifies errno, internalState@*/;
947
948void sync (void)
949 /*@modifies fileSystem@*/;
950
951int symlink (const char *path, const char *path2)
952 /*@modifies fileSystem@*/;
953
954int truncate (const char *name, off_t length)
955 /*@modifies errno, fileSystem@*/;
956
885824d3 957/*@constant int EBADRPC@*/
958/*@constant int ERPCMISMATCH@*/
959/*@constant int EPROGUNAVAIL@*/
960/*@constant int EPROGMISMATCH@*/
961/*@constant int EPROCUNAVAIL@*/
962/*@constant int EFTYPE@*/
963/*@constant int EAUTH@*/
964/*@constant int ENEEDAUTH@*/
965/*@constant int ELAST@*/
966
79127b5d 967/*
968** tar.h
969*/
885824d3 970
971/*@unchecked@*/ extern char *TMAGIC;
972/*@constant int TMAGLEN@*/
973/*@unchecked@*/ extern char *TVERSION;
974/*@constant int TVERSLEN@*/
975
976/*@constant int REGTYPE@*/
977/*@constant int AREGTYPE@*/
978/*@constant int LNKTYPE@*/
979/*@constant int SYMTYPE@*/
980/*@constant int CHRTYPE@*/
981/*@constant int BLKTYPE@*/
982/*@constant int DIRTYPE@*/
983/*@constant int FIFOTYPE@*/
984/*@constant int CONTTYPE@*/
985
986/*@constant int TSUID@*/
987/*@constant int TSGID@*/
988/*@constant int TSVTX@*/
989
990/*@constant int TUREAD@*/
991/*@constant int TUWRITE@*/
992/*@constant int TUEXEC@*/
993/*@constant int TGREAD@*/
994/*@constant int TGWRITE@*/
995/*@constant int TGEXEC@*/
996/*@constant int TOREAD@*/
997/*@constant int TOWRITE@*/
998/*@constant int TOEXEC@*/
999
1000struct ipc_perm {
1001 uid_t uid; /* user id */
1002 gid_t gid; /* group id */
1003 uid_t cuid; /* creator user id */
1004 gid_t cgid; /* creator group id */
1005 mode_t mode; /* r/w permission */
1006 ulong seq; /* slot usage sequence number */
1007 key_t key; /* user specified msg/sem/shm key */
1008} ;
1009
1010/*@constant int IPC_R@*/
1011/*@constant int IPC_W@*/
1012/*@constant int IPC_M@*/
1013/*@constant int IPC_CREAT@*/
1014/*@constant int IPC_EXCL@*/
1015/*@constant int IPC_NOWAIT@*/
1016/*@constant key_t IPC_PRIVATE@*/
1017/*@constant int IPC_RMID@*/
1018/*@constant int IPC_SET@*/
1019/*@constant int IPC_STAT@*/
1020
79127b5d 1021/*
1022** sys/msg.h
1023*/
885824d3 1024
1025 struct msqid_ds {
1026 struct ipc_perm msg_perm; /* msg queue permission bits */
1027 struct msg *msg_first; /* first message in the queue */
1028 struct msg *msg_last; /* last message in the queue */
1029 u_long msg_cbytes; /* number of bytes in use on the queue */
1030 u_long msg_qnum; /* number of msgs in the queue */
1031 u_long msg_qbytes; /* max # of bytes on the queue */
1032 pid_t msg_lspid; /* pid of last msgsnd() */
1033 pid_t msg_lrpid; /* pid of last msgrcv() */
1034 time_t msg_stime; /* time of last msgsnd() */
1035 time_t msg_rtime; /* time of last msgrcv() */
1036 time_t msg_ctime; /* time of last msgctl() */
1037};
1038
1039 struct mymesg {
1040 long mtype; /* message type (+ve integer) */
1041 char mtext[]; /* message body */
1042};
1043
1044/*@constant int MSG_NOERROR@*/
1045/*@constant int MSGMAX@*/
1046/*@constant int MSGMNB@*/
1047/*@constant int MSGMNI@*/
1048/*@constant int MSGTQL@*/
1049
1050 extern int
1051msgctl (int id , int cmd, /*@out@*/ struct msqid_ds *buf)
1052 /*@modifies errno, *buf@*/;
1053
1054 extern int
1055msgget (key_t key, int flag)
1056 /*@modifies errno@*/;
1057
1058 extern int
1059msgrcv (int id, /*@out@*/ void *ptr, size_t nbytes, long type, int flags)
1060 /*@modifies errno, *ptr@*/;
1061
1062 extern int
1063msgsnd (int id, const void *ptr, size_t nbytes, int flag)
1064 /*@modifies errno@*/;
1065
79127b5d 1066/*
1067** sys/sem.h
1068*/
885824d3 1069
1070 struct semid_ds {
1071 struct ipc_perm sem_perm;
1072 struct sem *sem_base;
1073 ushort sem_nsems;
1074 time_t sem_otime;
1075 time_t sem_ctime;
1076};
1077
1078 struct sem {
1079 ushort semval;
1080 pid_t sempid;
1081 ushort semncnt;
1082 ushort semzcnt;
1083};
1084
1085 union semun {
1086 int val;
1087 struct semid_ds *buf;
1088 ushort *array;
1089};
1090
1091 struct sembuf {
1092 ushort sem_num;
1093 short sem_op;
1094 short sem_flg;
1095};
1096
1097/*@constant int SEM_A@*/
1098/*@constant int SEMAEM@*/
1099/*@constant int SEMMNI@*/
1100/*@constant int SEMMNS@*/
1101/*@constant int SEMMNU@*/
1102/*@constant int SEMMSL@*/
1103/*@constant int SEMOPN@*/
1104/*@constant int SEM_R@*/
1105/*@constant int SEMUME@*/
1106/*@constant int SEM_UNDO@*/
1107/*@constant int SEMVMX@*/
1108/*@constant int GETVAL@*/
1109/*@constant int SETVAL@*/
1110/*@constant int GETPID@*/
1111/*@constant int GETNCNT@*/
1112/*@constant int GETZCNT@*/
1113/*@constant int GETALL@*/
1114/*@constant int SETALL@*/
1115
1116/*@constant int ERMID@*/
1117
1118 extern int
1119semctl (int id, int semnum, int cmd, union semun arg)
1120 /*@modifies errno@*/;
1121
1122 extern int
1123semget (key_t key, int nsems, int flag)
1124 /*@modifies errno@*/;
1125
1126 extern int
1127semop (int id, struct sembuf *semoparray, size_t nops)
1128 /*@modifies errno@*/;
1129
79127b5d 1130/*
1131** sys/shm.h
1132*/
885824d3 1133
1134 struct shmid_ds {
1135 struct ipc_perm shm_perm;
1136 int shm_segsz;
1137 ushort shm_lkcnt;
1138 pid_t shm_lpid;
1139 pid_t shm_cpid;
1140 ulong shm_nattch;
1141 ulong shm_cnattch;
1142 time_t shm_atime;
1143 time_t shm_dtime;
1144 time_t shm_ctime;
1145};
1146
1147/*@constant int SHMLBA@*/
1148/*@constant int SHM_LOCK@*/
1149/*@constant int SHMMAX@*/
1150/*@constant int SHMMIN@*/
1151/*@constant int SHMMNI@*/
1152/*@constant int SHM_R@*/
1153/*@constant int SHM_RDONLY@*/
1154/*@constant int SHM_RND@*/
1155/*@constant int SHMSEG@*/
1156/*@constant int SHM_W@*/
1157/*@constant int SHM_UNLOCK@*/
1158
79127b5d 1159void * shmat (int id, /*@null@*/ void *addr, int flag)
1160 /*@modifies errno@*/ ;
1161
1162extern int shmctl (int id, int cmd, /*@out@*/ struct shmid_ds *buf)
1163 /*@modifies errno, *buf@*/ ;
885824d3 1164
79127b5d 1165extern int shmdt (void *addr)
1166 /*@modifies errno@*/ ;
885824d3 1167
79127b5d 1168extern int shmget (key_t key, int size, int flag)
1169 /*@modifies errno@*/ ;
885824d3 1170
79127b5d 1171# if 0
1172 /*
1173 ** this is in stdio.h!
1174 */
885824d3 1175
79127b5d 1176/*
1177** stdio.h
1178*/
1179
1180/*
1181** evans 2001-12-30: added from http://www.opengroup.org/onlinepubs/007908799/xsh/stdio.h.html
1182*/
1183
1184/*@constant unsignedintegraltype BUFSIZ@*/
1185/*@constant unsignedintegraltype FILENAME_MAX@*/
1186/*@constant unsignedintegraltype FOPEN_MAX@*/
1187/*@constant bool _IOFBF@*/
1188/*@constant bool _IOLBF@*/
1189/*@constant bool _IONBF@*/
1190/*@constant unsignedintegraltype L_ctermid@*/
1191/*@constant unsignedintegraltype L_cuserid@*/
1192/*@constant unsignedintegraltype L_tmpnam@*/
1193/*@constant unsignedintegraltype SEEK_CUR@*/
1194/*@constant unsignedintegraltype SEEK_END@*/
1195/*@constant unsignedintegraltype SEEK_SET@*/
1196/*@constant unsignedintegraltype TMP_MAX@*/
1197
1198/* EOF */
1199/* NULL */
1200
1201/*@constant observer char *P_tmpdir@*/
1202
d5047b91 1203void clearerr (FILE *s)
1204 /*@modifies s@*/ ;
1205
79127b5d 1206/*@dependent@*/ char *ctermid (/*@returned@*/ /*@null@*/ char *) /*@*/ ;
1207 /* Result may be static pointer if parameter is NULL, otherwise is fresh. */
1208
1209char *cuserid (/*@null@*/ /*@returned@*/ char *)
1210 /*@warn legacy "cuserid is obsolete"@*/ /*@*/ ;
1211
d5047b91 1212/* fclose in standard.h */
1213
79127b5d 1214/*@null@*/ FILE *fdopen (int, const char *)
1215 /*@modifies errno, fileSystem@*/ ;
1216
d5047b91 1217/* feof, ferror fflush, fgetc, fgetpos, fgets - in standard.h */
1218
79127b5d 1219int fileno (/*@notnull@*/ FILE *)
1220 /*:errorcode -1:*/
1221 /*@modifies errno@*/ ;
1222
1223void flockfile (/*@notnull@*/ FILE *f)
1224 /*@modifies f, fileSystem@*/ ;
1225
1226int fseeko (FILE *stream, off_t offset, int whence)
1227 /*:errorcode -1:*/
1228 /*@modifies stream, errno@*/ ;
1229
1230off_t ftello(FILE *stream)
1231 /*:errorcode -1:*/ /*@modifies errno*/ ;
1232
1233int ftrylockfile(FILE *stream)
1234 /*:errorcode !0:*/
1235 /*@modifies stream, fileSystem, errno*/ ;
1236
1237void funlockfile (FILE *stream)
1238 /*@modifies stream, fileSystem*/ ;
1239
1240int getc_unlocked(FILE *stream)
1241 /*@warn multithreaded "getc_unlocked is a thread unsafe version of getc"@*/
1242 /*@modifies *stream, fileSystem, errno@*/ ;
1243
1244int getchar_unlocked (void)
1245 /*@warn multithreaded "getchar_unlocked is a thread unsafe version of getchar"@*/
1246 /*@globals stdin@*/
1247 /*@modifies *stdin, fileSystem@*/ ;
1248
1249int getopt (int, char * const[], const char)
1250 /*@warn legacy@*/ ;
1251
1252int getw (FILE *stream)
1253 /*:errorcode EOF:*/
1254 /*@modifies fileSystem, *stream, errno@*/ ;
1255
1256int pclose(FILE *stream)
1257 /*:errorcode -1:*/
1258 /*@modifies *stream, errno@*/ ;
1259
1260/*@null@*/ FILE *popen (const char *command, const char *mode)
1261 /*:errorcode NULL:*/
1262 /*@modifies fileSystem, errno@*/ ;
1263
1264int putc_unlocked (int, FILE *stream)
1265 /*@warn multithreaded "putc_unlocked is a thread unsafe version of putc"@*/
1266 /*:errorcode EOF:*/
1267 /*@modifies fileSystem, *stream, errno@*/ ;
1268
1269int putchar_unlocked(int)
1270 /*@warn multithreaded "putchar_unlocked is a thread unsafe version of putchar"@*/
1271 /*:errorcode EOF:*/
1272 /*@modifies fileSystem, *stdout, errno@*/ ;
1273
1274int putw(int, FILE *stream)
1275 /*:errorcode EOF:*/
1276 /*@modifies fileSystem, *stdout, errno@*/ ;
1277
1278int remove (const char *)
1279 /*@modifies fileSystem@*/ ;
1280
1281int rename (const char *, const char *)
1282 /*@modifies fileSystem@*/ ;
1283
1284void rewind (FILE *stream)
1285 /*@modifies *stream@*/ ;
1286
d5047b91 1287void setbuf (FILE *stream, /*@null@*/ /*@dependent@*/ /*@exposed@*/ char *buf)
1288 /*@modifies stream@*/
1289
1290int setvbuf (FILE *stream, /*@null@*/ /*@dependent@*/ /*@exposed@*/ char *buf, int type, size_t size)
1291 /*@modifies stream@*/
1292 /*:errorcode !0:*/ ;
1293
1294int snprintf (char *s, size_t n, const char *format, ...);
1295
79127b5d 1296 int sprintf(char *, const char *, ...);
1297 int sscanf(const char *, const char *, int ...);
1298 char *tempnam(const char *, const char *);
1299 FILE *tmpfile(void);
1300 char *tmpnam(char *);
1301 int ungetc(int, FILE *);
1302 int vfprintf(FILE *, const char *, va_list);
1303 int vprintf(const char *, va_list);
1304 int vsnprintf(char *, size_t, const char *, va_list);
1305 int vsprintf(char *, const char *, va_list);
1306
1307
1308 The following external variables are defined:
1309
1310
1311 extern char *optarg; )
1312 extern int opterr; )
1313 extern int optind; ) (LEGACY)
1314 extern int optopt; )
1315
1316# endif
1317
1318/*
1319** syslog.h
1320*/
885824d3 1321
1322/*@constant int LOG_EMERG@*/
1323/*@constant int LOG_ALERT@*/
1324/*@constant int LOG_CRIT@*/
1325/*@constant int LOG_ERR@*/
1326/*@constant int LOG_WARNING@*/
1327/*@constant int LOG_NOTICE@*/
1328/*@constant int LOG_INFO@*/
1329/*@constant int LOG_DEBUG@*/
1330
1331/*@constant int LOG_KERN@*/
1332/*@constant int LOG_USER@*/
1333/*@constant int LOG_MAIL@*/
1334/*@constant int LOG_DAEMON@*/
1335/*@constant int LOG_AUTH@*/
1336/*@constant int LOG_SYSLOG@*/
1337/*@constant int LOG_LPR@*/
1338/*@constant int LOG_NEWS@*/
1339/*@constant int LOG_UUCP@*/
1340/*@constant int LOG_CRON@*/
1341/*@constant int LOG_AUTHPRIV@*/
1342/*@constant int LOG_FTP@*/
1343/*@constant int LOG_LOCAL0@*/
1344/*@constant int LOG_LOCAL1@*/
1345/*@constant int LOG_LOCAL2@*/
1346/*@constant int LOG_LOCAL3@*/
1347/*@constant int LOG_LOCAL4@*/
1348/*@constant int LOG_LOCAL5@*/
1349/*@constant int LOG_LOCAL6@*/
1350/*@constant int LOG_LOCAL7@*/
1351
1352/*@constant int LOG_PID@*/
1353/*@constant int LOG_CONS@*/
1354/*@constant int LOG_ODELAY@*/
1355/*@constant int LOG_NDELAY@*/
1356/*@constant int LOG_NOWAIT@*/
1357/*@constant int LOG_PERROR@*/
1358
d5047b91 1359int LOG_MASK (int pri)
1360 /*@*/;
1361
1362int LOG_UPTO (int pri)
1363 /*@*/;
1364
1365void closelog (void)
1366 /*@modifies fileSystem@*/;
1367
1368void openlog (const char *ident, int logopt, int facility)
1369 /*@modifies fileSystem@*/;
1370
1371int setlogmask (int maskpri)
1372 /*@modifies internalState@*/;
1373
1374void /*@printflike@*/ syslog (int priority, const char *message, ...)
1375 /*@modifies fileSystem@*/;
1376
1377void vsyslog (int priority, const char *message, va_list args)
1378 /*@modifies fileSystem@*/;
885824d3 1379
1380/*________________________________________________________________________
1381 * pwd.h
1382 */
1383
1384 extern extern void
1385endpwent (void)
1386 /*@modifies internalState@*/;
1387
1388 extern /*@null@*/ struct passwd *
1389getpwent (void)
1390 /*@modifies internalState@*/;
1391
1392 extern int
1393setpassent (int stayopen)
1394 /*@modifies internalState@*/;
1395
1396 extern int
1397setpwent (void)
1398 /*@modifies internalState@*/;
1399
1400/*________________________________________________________________________
1401 * grp.h
1402 */
1403
1404 extern void
1405endgrent (void)
1406 /*@modifies internalState@*/;
1407
1408 extern /*@null@*/ struct group *
1409getgrent (void)
1410 /*@modifies internalState@*/;
1411
1412 extern int
1413setgrent (void)
1414 /*@modifies internalState@*/;
1415
1416 extern void
1417setgrfile (const char *name)
1418 /*@modifies internalState@*/;
1419
1420 extern int
1421setgroupent (int stayopen)
1422 /*@modifies internalState@*/;
1423
1d239d69 1424/*
1425** sys/stat.h
1426**
1427** evans 2001-08-26 - updated from http://www.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html
1428*/
1429
1430/*
1431** struct stat replaces POSIX version - more required fields in Unix
1432*/
1433
8fe44445 1434/*@-redef@*/ /*@-matchfields@*/
1d239d69 1435struct stat {
1436 dev_t st_dev; /* ID of device containing file */
1437 ino_t st_ino; /* file serial number */
1438 mode_t st_mode; /* mode of file (see below) */
1439 nlink_t st_nlink; /* number of links to the file */
1440 uid_t st_uid; /* user ID of file */
1441 gid_t st_gid; /* group ID of file */
1442 dev_t st_rdev; /* device ID (if file is character or block special) */
1443 off_t st_size; /* file size in bytes (if file is a regular file) */
1444 time_t st_atime; /* time of last access */
1445 time_t st_mtime; /* time of last data modification */
1446 time_t st_ctime; /* time of last status change */
1447 blksize_t st_blksize; /* a filesystem-specific preferred I/O block size for
1448 this object. In some filesystem types, this may
1449 vary from file to file */
1450 blkcnt_t st_blocks; /* number of blocks allocated for this object */
8fe44445 1451} ;
1452/*@=redef@*/ /*@=matchfields@*/
885824d3 1453
1d239d69 1454/*@constant mode_t S_IWUSR@*/
1455/*@constant mode_t S_IXUSR@*/
1456/*@constant mode_t S_IRWXG@*/
1457/*@constant mode_t S_IRGRP@*/
1458/*@constant mode_t S_IWGRP@*/
1459/*@constant mode_t S_IXGRP@*/
1460/*@constant mode_t S_IRWXO@*/
1461/*@constant mode_t S_IROTH@*/
1462/*@constant mode_t S_IWOTH@*/
1463/*@constant mode_t S_IXOTH@*/
1464/*@constant mode_t S_ISUID@*/
1465/*@constant mode_t S_ISGID@*/
1466/*@constant mode_t S_ISVTX@*/
1467
1468# if 0
345671f3 1469/*These are the old definitions - they don't appear to be in the Single UNIX Specification */
1470
885824d3 1471/*@constant int S_ISTXT@*/
1472/*@constant int S_IREAD@*/
1473/*@constant int S_IWRITE@*/
1474/*@constant int S_IEXEC@*/
1475/*@constant int S_IFMT@*/
1476/*@constant int S_IFIFO@*/
1477/*@constant int S_IFCHR@*/
1478/*@constant int S_IFDIR@*/
1479/*@constant int S_IFBLK@*/
1480/*@constant int S_IFREG@*/
1481/*@constant int S_IFLNK@*/
1482/*@constant int S_IFSOCK@*/
1483/*@constant int S_ISVTX@*/
1484/*@constant int S_ISVTX@*/
1485/*@constant int SF_SETTABLE@*/
1486/*@constant int SF_ARCHIVED@*/
1487/*@constant int ACCESSPERMS@*/
1488/*@constant int ALLPERMS@*/
1489/*@constant int DEFFILEMODE@*/
1490/*@constant int S_BLKSIZE@*/
1491/*@constant int SF_IMMUTABLE@*/
1492/*@constant int SF_APPEND@*/
1493/*@constant int UF_NODUMP@*/
1494/*@constant int UF_IMMUTABLE@*/
1495/*@constant int UF_APPEND@*/
1d239d69 1496# endif
885824d3 1497
1d239d69 1498int /*@alt lltX_bool@*/ S_ISBLK (/*@sef@*/ mode_t m) /*@*/;
1499int /*@alt lltX_bool@*/ S_ISCHR (/*@sef@*/ mode_t m) /*@*/;
1500int /*@alt lltX_bool@*/ S_ISDIR (/*@sef@*/ mode_t m) /*@*/;
1501int /*@alt lltX_bool@*/ S_ISFIFO (/*@sef@*/ mode_t m) /*@*/;
1502int /*@alt lltX_bool@*/ S_ISREG (/*@sef@*/ mode_t m) /*@*/;
1503int /*@alt lltX_bool@*/ S_ISLNK (/*@sef@*/ mode_t m) /*@*/;
885824d3 1504
1d239d69 1505int /*@alt lltX_bool@*/ S_TYPEISMQ (/*@sef@*/ struct stat *buf) /*@*/ ;
1506int /*@alt lltX_bool@*/ S_TYPEISSEM (/*@sef@*/ struct stat *buf) /*@*/ ;
1507int /*@alt lltX_bool@*/ S_TYPEISSHM (/*@sef@*/ struct stat *buf) /*@*/ ;
885824d3 1508
1d239d69 1509/* in POSIX: chmod, fstat, mkdir, mkfifo, stat, umask */
885824d3 1510
1d239d69 1511int lstat(const char *, /*@out@*/ struct stat *)
b87215ab 1512 /*:errorcode -1:*/
1513 /*@modifies errno@*/ ;
1514
1d239d69 1515int mknod (const char *, mode_t, dev_t)
1516 /*@warn portability "The only portable use of mknod is to create FIFO-special file. If mode is not S_IFIFO or dev is not 0, the behaviour of mknod() is unspecified."@*/
1517 /*:errorcode -1:*/
1518 /*@modifies errno@*/ ;
885824d3 1519
1d239d69 1520int chflags (const char *path, u_long flags)
1521 /*@warn unixstandard "Not in Single UNIX Specification Version 2"@*/
1522 /*@modifies fileSystem, errno@*/;
1523
1524int fchflags (int fd, u_long flags)
1525 /*@warn unixstandard "Not in Single UNIX Specification Version 2"@*/
1526 /*@modifies fileSystem, errno@*/;
885824d3 1527
b87215ab 1528/* evans 2002-03-17: this was missing, reported by Ralf Wildenhues */
1529int fchmod(int fildes, mode_t mode)
1530 /*@modifies fileSystem, errno@*/ ;
1531
1532/*
1533** sys/statvfs.h
1534** from http://www.opengroup.org/onlinepubs/007908799/xsh/sysstatvfs.h.html
1535*/
1536
1537struct statvfs {
1538 unsigned long f_bsize;
1539 unsigned long f_frsize;
1540 fsblkcnt_t f_blocks;
1541 fsblkcnt_t f_bfree;
1542 fsblkcnt_t f_bavail;
1543 fsfilcnt_t f_files;
1544 fsfilcnt_t f_ffree;
1545 fsfilcnt_t f_favail;
1546 unsigned long f_fsid;
1547 unsigned long f_flag;
1548 unsigned long f_namemax;
1549} ;
1550
1551/*@constant unsigned long ST_RDONLY; @*/
1552/*@constant unsigned long ST_NOSUID; @*/
1553
1554int fstatvfs (int fildes, /*@out@*/ struct statvfs *buf)
1555 /*@modifies buf@*/ ;
1556
1557int statvfs (const char *path, /*@out@*/ struct statvfs *buf)
1558 /*@modifies buf@*/ ;
1559
1560
885824d3 1561/*________________________________________________________________________
1562 * stropts.h
1563 */
1564
1565/*@constant int FMNAMESZ@*/
1566/*@constant int MSG_BAND@*/
1567/*@constant int MSG_HIPRI@*/
1568/*@constant int RS_HIPRI@*/
1569/*@constant int S_INPUT@*/
1570/*@constant int S_RDNORM@*/
1571/*@constant int S_RDBAND@*/
1572/*@constant int S_BANDURG@*/
1573/*@constant int S_HIPRI@*/
1574/*@constant int S_OUTPUT@*/
1575/*@constant int S_WRNORM@*/
1576/*@constant int S_WRBAND@*/
1577/*@constant int S_MSG@*/
1578/*@constant int S_ERROR@*/
1579/*@constant int S_HANGUP@*/
1580
1581 struct strbuf {
1582 int maxlen;
1583 int len;
1584 char *buf;
1585}
1586
1587 struct str_mlist {
1588 char l_name[];
1589}
1590
1591 struct str_list {
1592 int sl_nmods;
1593 struct str_mlist *sl_modlist;
1594}
1595
1596 extern int
1597getmsg (int fd, /*@out@*/ struct strbuf *c, /*@out@*/ struct strbuf *d, int *f)
1598 /*@modifies *c, *d, errno@*/;
1599
1600 extern int
1601getpmsg (int fd, /*@out@*/ struct strbuf *c, /*@out@*/ struct strbuf *d, int *b, int *f)
1602 /*@modifies *b, *c, *d, errno@*/;
1603
1604 extern int
1605putmsg (int fd, const struct strbuf *c, const struct strbuf *d, int *f)
1606 /*@modifies internalState, errno@*/;
1607
dfd82dce 1608extern int putpmsg (int fd, const struct strbuf *c, const struct strbuf *d, int b, int *f)
1609 /*@modifies internalState, errno@*/;
885824d3 1610
1611/*________________________________________________________________________
1612 * sys/resource.h
1613 */
1614
1615/*@constant int RLIMIT_CPU@*/
1616/*@constant int RLIMIT_FSIZE@*/
1617/*@constant int RLIMIT_DATA@*/
1618/*@constant int RLIMIT_STACK@*/
1619/*@constant int RLIMIT_CORE@*/
1620/*@constant int RLIMIT_RSS@*/
1621/*@constant int RLIMIT_MEMLOCK@*/
1622/*@constant int RLIMIT_NPROC@*/
1623/*@constant int RLIMIT_NOFILE@*/
1624/*@constant int RLIM_NLIMITS@*/
1625/*@constant int RLIM_INFINITY@*/
1626/*@constant int PRIO_MIN@*/
1627/*@constant int PRIO_MAX@*/
1628/*@constant int PRIO_PROCESS@*/
1629/*@constant int PRIO_PGRP@*/
1630/*@constant int PRIO_USER@*/
1631/*@constant int RUSAGE_SELF@*/
1632/*@constant int RUSAGE_CHILDREN@*/
1633
1634 struct rusage {
1635 struct timeval ru_utime; /* user time used */
1636 struct timeval ru_stime; /* system time used */
1637 long ru_maxrss; /* max resident set size */
1638 long ru_ixrss; /* integral shared memory size */
1639 long ru_idrss; /* integral unshared data " */
1640 long ru_isrss; /* integral unshared stack " */
1641 long ru_minflt; /* page reclaims */
1642 long ru_majflt; /* page faults */
1643 long ru_nswap; /* swaps */
1644 long ru_inblock; /* block input operations */
1645 long ru_oublock; /* block output operations */
1646 long ru_msgsnd; /* messages sent */
1647 long ru_msgrcv; /* messages received */
1648 long ru_nsignals; /* signals received */
1649 long ru_nvcsw; /* voluntary context switches */
1650 long ru_nivcsw; /* involuntary " */
1651};
1652
1653 struct rlimit {
1654 long rlim_cur;
1655 long rlim_max;
1656};
1657
1658 struct loadavg {
1659 unsigned long ldavg[3];
1660 long fscale;
1661};
1662
1663 extern int
1664getpriority (int which, int who)
1665 /*@modifies errno@*/;
1666
1667 extern int
1668getrlimit (int res, /*@out@*/ struct rlimit *rlp)
1669 /*@modifies *rlp, errno@*/;
1670
1671 extern int
1672getrusage (int who, /*@out@*/ struct rusage *rusage)
1673 /*@modifies *rusage, errno@*/;
1674
1675 extern int
1676setpriority (int which, int who, int prio)
1677 /*@modifies errno, internalState@*/;
1678
1679 extern int
1680setrlimit (int resource, const struct rlimit *rlp)
1681 /*@modifies errno, internalState@*/;
1682
7272a1c1 1683
1684/*
1685** in <netdb.h>
1686*/
1687
1688struct servent
1689{
1690 /*@observer@*/ char *s_name; /* Official service name. */
1691 /*@observer@*/ char **s_aliases; /* Alias list. */
1692 int s_port; /* Port number. */
1693 /*@observer@*/ char *s_proto; /* Protocol to use. */
1694} ;
1695
1696/*@observer@*/ /*@dependent@*/ /*@null@*/ struct servent *getservbyname (const char *name, /*@null@*/ const char *proto)
1697 /*@warn multithreaded "Unsafe in multithreaded applications, use getsrvbyname_r instead"@*/ ;
1698
1699struct servent *getservbyname_r (const char *name, /*@null@*/ const char *proto, /*@out@*/ /*@returned@*/ struct servent *result, /*@out@*/ char *buffer, int buflen)
1700 /*@requires maxSet (buffer) >= buflen@*/ ;
1701
1702
1703/*@observer@*/ /*@dependent@*/ struct servent *getservbyport (int port, /*@null@*/ const char *proto)
1704 /*@warn multithreaded "Unsafe in multithreaded applications, use getservbyport_r instead"@*/ ;
1705
1706struct servent *getservbyport_r (int port, /*@null@*/ const char *proto, /*@out@*/ /*@returned@*/ struct servent *result, /*@out@*/ char *buffer, int buflen)
1707 /*@requires maxSet (buffer) >= buflen@*/ ;
1708
1709/*@null@*/ struct servent *getservent (void);
1710
1711/*@null@*/ struct servent *getservent_r (struct servent *result, char *buffer, int buflen);
1712
1713int setservent (int stayopen);
7272a1c1 1714int endservent (void);
1715
7272a1c1 1716extern int h_errno;
1717
1718/*@null@*/ /*@observer@*/ struct hostent *gethostbyname (/*@nullterminated@*/ /*@notnull@*/ const char *name)
1719 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostbyname_r instead"@*/
1720 /*@modifies h_errno@*/ ;
1721
1722struct hostent *gethostbyname_r (/*@nullterminated@*/ const char *name, /*@notnull@*/ /*@returned@*/ struct hostent *hent, /*@out@*/ /*@exposed@*/ char *buffer, int bufsize, /*@out@*/ int *h_errnop)
1723 /*@requires maxSet(buffer) >= bufsize@*/ ;
1724
1725/*@null@*/ /*@observer@*/ struct hostent *gethostbyaddr (/*@notnull@*/ const void *addr, size_t addrlen, int type)
8fe44445 1726 /*@requires maxRead(addr) == addrlen@*/ /*:i534 ??? is this right? */
7272a1c1 1727 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostbyaddr_r instead"@*/
1728 /*@modifies h_errno@*/ ;
1729
1730struct hostent *gethostbyaddr_r (/*@notnull@*/ const void *addr, size_t addrlen, int type,
1731 /*@returned@*/ /*@out@*/ struct hostent *hent,
1732 /*@exposed@*/ /*@out@*/ char *buffer, int bufsize, /*@out@*/ int *h_errnop)
8fe44445 1733 /*@requires maxRead(addr) == addrlen /\ maxSet(buffer) >= bufsize@*/
1734 /*:i534 ??? is this right? */ ;
7272a1c1 1735
1736/*@observer@*/ /*@null@*/ struct hostent *gethostent (void)
1737 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostent_r instead"@*/ ;
1738
1739struct hostent *gethostent_r (/*@out@*/ /*@returned@*/ struct hostent *hent, /*@exposed@*/ /*@out@*/ char *buffer, int bufsize)
1740 /*@requires maxSet(buffer) >= bufsize@*/ ;
1741
8fe44445 1742/*:i534 need to annotate these: */
7272a1c1 1743
8fe44445 1744struct hostent *fgethostent(FILE *f);
7272a1c1 1745struct hostent *fgethostent_r(FILE*f, struct hostent *hent, char buffer, int bufsize);
7272a1c1 1746void sethostent(int stayopen);
7272a1c1 1747void endhostent(void);
7272a1c1 1748void herror(const char *string);
7272a1c1 1749char *hstrerror(int err);
1750
1751struct hostent {
1752 /*@observer@*/ /*@nullterminated@*/ char *h_name; /* official name of host */
1753 /*@observer@*/ /*@nullterminated@*/ char * /*:observer@*/ /*:nullterminated@*/ *h_aliases; /* alias list */
1754 int h_addrtype; /* host address type*/
1755 int h_length; /* length ofaddress*/
1756 /*@observer@*/ /*@nullterminated@*/ char * /*:observer@*/ /*:nullterminated@*/ *h_addr_list; /* list of addressesfrom name server */
1757 /*@observer@*/ /*@nullterminated@*/ char *h_addr; /* first address in list (backward compatibility) */
1758} ;
1759
7272a1c1 1760/*
1761** unistd.h
b87215ab 1762** from http://www.opengroup.org/onlinepubs/007908799/xsh/unistd.h.html
7272a1c1 1763*/
1764
b87215ab 1765/*@constant int _POSIX_VERSION@*/
1766/*@constant int _POSIX2_VERSION@*/
1767/*@constant int _POSIX2_C_VERSION@*/
1768/*@constant int _XOPEN_VERSION@*/
1769/*@constant int _XOPEN_XCU_VERSION@*/
1770
1771/* for access: */
1772
1773/*@constant int R_OK@*/
1774/*@constant int W_OK@*/
1775/*@constant int X_OK@*/
1776/*@constant int F_OK@*/
1777
1778/* for confstr: */
1779/*@constant int _CS_PATH@*/
1780/*@constant int _CS_XBS5_ILP32_OFF32_CFLAGS@*/
1781/*@constant int _CS_XBS5_ILP32_OFF32_LDFLAGS@*/
1782/*@constant int _CS_XBS5_ILP32_OFF32_LIBS@*/
1783/*@constant int _CS_XBS5_ILP32_OFF32_LINTFLAGS@*/
1784/*@constant int _CS_XBS5_ILP32_OFFBIG_CFLAGS@*/
1785/*@constant int _CS_XBS5_ILP32_OFFBIG_LDFLAGS@*/
1786/*@constant int _CS_XBS5_ILP32_OFFBIG_LIBS@*/
1787/*@constant int _CS_XBS5_ILP32_OFFBIG_LINTFLAGS@*/
1788/*@constant int _CS_XBS5_LP64_OFF64_CFLAGS@*/
1789/*@constant int _CS_XBS5_LP64_OFF64_LDFLAGS@*/
1790/*@constant int _CS_XBS5_LP64_OFF64_LIBS@*/
1791/*@constant int _CS_XBS5_LP64_OFF64_LINTFLAGS@*/
1792/*@constant int _CS_XBS5_LPBIG_OFFBIG_CFLAGS@*/
1793/*@constant int _CS_XBS5_LPBIG_OFFBIG_LDFLAGS@*/
1794/*@constant int _CS_XBS5_LPBIG_OFFBIG_LIBS@*/
1795/*@constant int _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS@*/
1796
1797/* name parameters to sysconf: */
1798
1799/*@constant int _SC_2_C_BIND@*/
1800/*@constant int _SC_2_C_DEV@*/
1801/*@constant int _SC_2_C_VERSION@*/
1802/*@constant int _SC_2_FORT_DEV@*/
1803/*@constant int _SC_2_FORT_RUN@*/
1804/*@constant int _SC_2_LOCALEDEF@*/
1805/*@constant int _SC_2_SW_DEV@*/
1806/*@constant int _SC_2_UPE@*/
1807/*@constant int _SC_2_VERSION@*/
1808/*@constant int _SC_ARG_MAX@*/
1809/*@constant int _SC_AIO_LISTIO_MAX@*/
1810/*@constant int _SC_AIO_MAX@*/
1811/*@constant int _SC_AIO_PRIO_DELTA_MAX@*/
1812/*@constant int _SC_ASYNCHRONOUS_IO@*/
1813/*@constant int _SC_ATEXIT_MAX@*/
1814/*@constant int _SC_BC_BASE_MAX@*/
1815/*@constant int _SC_BC_DIM_MAX@*/
1816/*@constant int _SC_BC_SCALE_MAX@*/
1817/*@constant int _SC_BC_STRING_MAX@*/
1818/*@constant int _SC_CHILD_MAX@*/
1819/*@constant int _SC_CLK_TCK@*/
1820/*@constant int _SC_COLL_WEIGHTS_MAX@*/
1821/*@constant int _SC_DELAYTIMER_MAX@*/
1822/*@constant int _SC_EXPR_NEST_MAX@*/
1823/*@constant int _SC_FSYNC@*/
1824/*@constant int _SC_GETGR_R_SIZE_MAX@*/
1825/*@constant int _SC_GETPW_R_SIZE_MAX@*/
1826/*@constant int _SC_IOV_MAX@*/
1827/*@constant int _SC_JOB_CONTROL@*/
1828/*@constant int _SC_LINE_MAX@*/
1829/*@constant int _SC_LOGIN_NAME_MAX@*/
1830/*@constant int _SC_MAPPED_FILES@*/
1831/*@constant int _SC_MEMLOCK@*/
1832/*@constant int _SC_MEMLOCK_RANGE@*/
1833/*@constant int _SC_MEMORY_PROTECTION@*/
1834/*@constant int _SC_MESSAGE_PASSING@*/
1835/*@constant int _SC_MQ_OPEN_MAX@*/
1836/*@constant int _SC_MQ_PRIO_MAX@*/
1837/*@constant int _SC_NGROUPS_MAX@*/
1838/*@constant int _SC_OPEN_MAX@*/
1839/*@constant int _SC_PAGESIZE@*/
1840/*@constant int _SC_PAGE_SIZE@*/
1841/*@constant int _SC_PASS_MAX@*/
1842/*@constant int _SC_PRIORITIZED_IO@*/
1843/*@constant int _SC_PRIORITY_SCHEDULING@*/
1844/*@constant int _SC_RE_DUP_MAX@*/
1845/*@constant int _SC_REALTIME_SIGNALS@*/
1846/*@constant int _SC_RTSIG_MAX@*/
1847/*@constant int _SC_SAVED_IDS@*/
1848/*@constant int _SC_SEMAPHORES@*/
1849/*@constant int _SC_SEM_NSEMS_MAX@*/
1850/*@constant int _SC_SEM_VALUE_MAX@*/
1851/*@constant int _SC_SHARED_MEMORY_OBJECTS@*/
1852/*@constant int _SC_SIGQUEUE_MAX@*/
1853/*@constant int _SC_STREAM_MAX@*/
1854/*@constant int _SC_SYNCHRONIZED_IO@*/
1855/*@constant int _SC_THREADS@*/
1856/*@constant int _SC_THREAD_ATTR_STACKADDR@*/
1857/*@constant int _SC_THREAD_ATTR_STACKSIZE@*/
1858/*@constant int _SC_THREAD_DESTRUCTOR_ITERATIONS@*/
1859/*@constant int _SC_THREAD_KEYS_MAX@*/
1860/*@constant int _SC_THREAD_PRIORITY_SCHEDULING@*/
1861/*@constant int _SC_THREAD_PRIO_INHERIT@*/
1862/*@constant int _SC_THREAD_PRIO_PROTECT@*/
1863/*@constant int _SC_THREAD_PROCESS_SHARED@*/
1864/*@constant int _SC_THREAD_SAFE_FUNCTIONS@*/
1865/*@constant int _SC_THREAD_STACK_MIN@*/
1866/*@constant int _SC_THREAD_THREADS_MAX@*/
1867/*@constant int _SC_TIMERS@*/
1868/*@constant int _SC_TIMER_MAX@*/
1869/*@constant int _SC_TTY_NAME_MAX@*/
1870/*@constant int _SC_TZNAME_MAX@*/
1871/*@constant int _SC_VERSION@*/
1872/*@constant int _SC_XOPEN_VERSION@*/
1873/*@constant int _SC_XOPEN_CRYPT@*/
1874/*@constant int _SC_XOPEN_ENH_I18N@*/
1875/*@constant int _SC_XOPEN_SHM@*/
1876/*@constant int _SC_XOPEN_UNIX@*/
1877/*@constant int _SC_XOPEN_XCU_VERSION@*/
1878/*@constant int _SC_XOPEN_LEGACY@*/
1879/*@constant int _SC_XOPEN_REALTIME@*/
1880/*@constant int _SC_XOPEN_REALTIME_THREADS@*/
1881/*@constant int _SC_XBS5_ILP32_OFF32@*/
1882/*@constant int _SC_XBS5_ILP32_OFFBIG@*/
1883/*@constant int _SC_XBS5_LP64_OFF64@*/
1884/*@constant int _SC_XBS5_LPBIG_OFFBIG@*/
1885
1886
1887int access(const char *, int) /*@modifies errno@*/ /*:errorcode -1:*/ ;
1888unsigned int alarm (unsigned int) /*@modifies internalState@*/ ;
1889
1890int brk(void *)
1891 /*@modifies errno@*/
1892 /*:errorcode -1:*/
1893 /*@warn legacy "brk is obsolete"@*/ ;
1894
1895int chdir (const char *)
1896 /*@modifies internalState, errno@*/
1897 /*:errorcode -1:*/ ;
1898
1899int chown (const char *, uid_t, gid_t)
1900 /*@modifies internalState, errno@*/
1901 /*:errorcode -1:*/ ;
1902
1903int close (int)
1904 /*@modifies internalState, errno@*/
1905 /*:errorcode -1:*/ ;
1906
1907size_t confstr(int, /*@null@*/ char *, size_t)
1908 /*@globals internalState@*/
1909 /*@modifies errno@*/
1910 /*:errorcode 0:*/ ;
1911
1912/*@dependent@*/ /*@null@*/ char *crypt(const char *, const char *)
1913 /*@modifies errno, internalState@*/ ;
1914
1915/*@dependent@*/ /*@null@*/ char *ctermid(/*@returned@*/ /*@null@*/ /*@out@*/ char *s)
1916 /*@modifies s@*/ ;
1917
1918/*@null@*/ /*@dependent@*/ char *cuserid (/*@null@*/ /*@returned@*/ char *s)
1919 /*@warn legacy "cuserid is obsolete"@*/
1920 /*@modifies s@*/ ;
1921
1922int dup(int)
1923 /*@modifies errno, internalState@*/
1924 /*:errorcode -1:*/ ;
1925
1926int dup2(int, int)
1927 /*@modifies errno, internalState@*/
1928 /*:errorcode -1:*/ ;
1929
1930void encrypt(char p_block[], int)
1931 /*@requires maxSet(p_block) == 63@*/
1932 /*@modifies p_block, errno@*/ ;
1933
1934extern char **environ;
1935
1936int execl (const char *, const char *, ...)
1937 /*@modifies errno, internalState@*/
1938 /*:errorcode -1:*/ ;
1939
1940int execle(const char *, const char *, ...)
1941 /*@modifies errno, internalState@*/
1942 /*:errorcode -1:*/ ;
1943
1944int execlp(const char *, const char *, ...)
1945 /*@modifies errno, internalState@*/
1946 /*:errorcode -1:*/ ;
1947
1948int execv(const char *, char *const [])
1949 /*@modifies errno, internalState@*/
1950 /*:errorcode -1:*/ ;
1951
1952int execve(const char *, char *const [], char *const [])
1953 /*@modifies errno, internalState@*/
1954 /*:errorcode -1:*/ ;
1955
1956int execvp(const char *, char *const [])
1957 /*@modifies errno, internalState@*/
1958 /*:errorcode -1:*/ ;
1959
1960/*@exits@*/ void _exit (int);
1961
1962int fchown (int, uid_t, gid_t)
1963 /*@modifies errno, fileSystem@*/
1964 /*:errorcode -1:*/ ;
1965
1966int fchdir (int)
1967 /*@modifies errno, fileSystem@*/
1968 /*:errorcode -1:*/ ;
1969
1970int fdatasync (int)
1971 /*@modifies errno, fileSystem@*/
1972 /*:errorcode -1:*/ ;
1973
1974pid_t fork (void)
1975 /*@modifies errno, internalState@*/
1976 /*:errorcode -1:*/ ;
1977
1978long int fpathconf(int, int)
1979 /*@modifies errno, internalState@*/
1980 /*:errorcode -1:*/ ;
1981
1982int fsync(int)
1983 /*@modifies errno, fileSystem@*/
1984 /*:errorcode -1:*/ ;
1985
1986int ftruncate(int, off_t)
1987 /*@modifies errno, fileSystem@*/
1988 /*:errorcode -1:*/ ;
1989
1990/*@null@*/ char *getcwd (/*@returned@*/ char *buf, size_t size)
1991 /*@requires maxSet(buf) >= size;@*/
1992 /*@modifies errno@*/ ;
1993
1994int getdtablesize (void)
1995 /*@warn legacy "getdtablesize is obsolete"@*/ ;
1996
1997gid_t getegid (void) /*@globals internalState*/ ;
1998uid_t geteuid (void) /*@globals internalState*/ ;
1999gid_t getgid (void) /*@globals internalState*/ ;
2000
2001int getgroups (int gidsetsize, gid_t grouplist[])
2002 /*@requires maxSet(grouplist) >= gidsetsize@*/
2003 /*@modifies errno@*/
2004 /*:errorcode -1:*/ ;
2005
2006long gethostid (void) /*@globals internalState@*/ ;
2007
2008/*@null@*/ /*@dependent@*/ char *getlogin (void)
2009 /*@modifies errno@*/ ;
2010
2011int getlogin_r (char *name, size_t namesize)
2012 /*@requires maxSet(name) >= namesize@*/
2013 /*:errorcode !0:*/ ;
2014
2015extern char *optarg;
2016extern int optind;
2017extern int opterr;
2018extern int optopt;
2019
2020int getopt(int, char * const [], const char *)
2021 /*@modifies optind, opterr, optopt, errno@*/
2022 /*:errorcode -1:*/ ;
2023
2024int getpagesize(void)
2025 /*@warn legacy "getpagesize is obsolete"@*/ ;
2026
2027/*@dependent@*/ /*@null@*/ char *getpass(/*@nullterminated@*/ const char *)
2028 /*@warn legacy "getpass is obsolete"@*/ ;
2029
2030pid_t getpgid(pid_t)
2031 /*@modifies errno@*/
2032 /*@globals internalState@*/
2033 /*:errorcode (pid_t)-1:*/ ;
2034
2035pid_t getpgrp(void) /*@globals internalState*/ ;
2036
2037pid_t getpid(void) /*@globals internalState*/ ;
2038pid_t getppid(void) /*@globals internalState*/ ;
2039
2040pid_t getsid(pid_t)
2041 /*@modifies errno@*/
2042 /*@globals internalState@*/
2043 /*:errorcode (pid_t)-1:*/ ;
2044
2045uid_t getuid(void) /*@globals internalState@*/ ;
2046
2047/*@null@*/ char *getwd (/*@returned@*/ char *path_name)
2048 /*@modifies path_name@*/ ;
2049
2050int isatty(int)
2051 /*@globals internalState@*/
2052 /*@modifies errno@*/
2053 /*:errorcode 0:*/ ;
2054
2055int lchown(const char *, uid_t, gid_t)
2056 /*@modifies errno, fileSystem@*/
2057 /*:errorcode -1:*/ ;
2058
2059int link(const char *, const char *)
2060 /*@modifies errno, fileSystem@*/
2061 /*:errorcode -1:*/ ;
2062
2063int lockf(int, int, off_t)
2064 /*@modifies errno, fileSystem@*/
2065 /*:errorcode -1:*/ ;
2066
2067off_t lseek(int, off_t, int)
2068 /*@modifies errno, fileSystem@*/
2069 /*:errorcode (off_t)-1:*/ ;
2070
2071int nice(int)
2072 /*@modifies errno, fileSystem@*/
2073 /*:errorcode -1:*/ ;
2074
2075long int pathconf(const char *, int)
2076 /*@modifies errno, internalState@*/
2077 /*:errorcode -1:*/ ;
2078
2079int pause(void)
2080 /*@modifies errno, internalState@*/
2081 /*:errorcode -1:*/ ;
2082
2083int pipe(int p[])
2084 /*@requires maxRead(p) == 1@*/
2085 /*@modifies errno, fileSystem@*/
2086 /*:errorcode -1:*/ ;
2087
2088ssize_t pread(int, /*@out@*/ void *buf, size_t nbyte, off_t offset)
2089 /*@modifies errno, fileSystem@*/
2090 /*@requires maxSet(buf) >= (nbyte - 1) @*/
2091 /*@ensures maxRead(buf) >= nbyte @*/
2092 /*:errorcode -1:*/ ;
2093
2094int pthread_atfork(void (*)(void), void (*)(void), void(*)(void))
2095 /*@modifies errno, fileSystem@*/
2096 /*:errorcode !0:*/ ;
2097
2098ssize_t pwrite(int, const void *buf, size_t nbyte, off_t)
2099 /*@requires maxRead(buf) >= nbyte@*/
2100 /*@modifies errno, fileSystem@*/
2101 /*:errorcode -1:*/ ;
2102
2103/* ssize_t read(int, void *, size_t); in posix.h */
2104
2105int readlink(const char *, char *buf, size_t bufsize)
2106 /*@requires maxSet(buf) >= (bufsize - 1)@*/
2107 /*@modifies errno, fileSystem, *buf@*/
2108 /*:errorcode -1:*/ ;
2109
2110/* int rmdir(const char *); in posix.h */
2111
2112void *sbrk(intptr_t)
2113 /*@modifies errno@*/
2114 /*:errorcode (void *)-1:*/
2115 /*@warn legacy "sbrk is obsolete"@*/ ;
2116
2117 /* int setgid(gid_t);
2118 int setpgid(pid_t, pid_t);
2119 */
2120
2121pid_t setpgrp(void) /*@modifies internalState@*/ ;
2122
2123int setregid(gid_t, gid_t)
2124 /*@modifies errno, internalState@*/
2125 /*:errorcode -1:*/ ;
2126
2127int setreuid(uid_t, uid_t)
2128 /*@modifies errno, internalState@*/
2129 /*:errorcode -1:*/ ;
2130
2131pid_t setsid(void)
2132 /*@modifies errno, internalState@*/
2133 /*:errorcode (pid_t) -1:*/ ;
2134
2135int setuid(uid_t)
2136 /*@modifies errno, internalState@*/
2137 /*:errorcode -1:*/ ;
2138
2139unsigned int sleep(unsigned int)
2140 /*@modifies systemState@*/ ;
2141
2142void swab(/*@unique@*/ const void *src, /*@unique@*/ void *dest, ssize_t nbytes)
2143 /*@requires maxSet(dest) >= (nbytes - 1)@*/ ;
2144
2145int symlink(const char *, const char *)
2146 /*@modifies errno, fileSystem@*/
2147 /*:errorcode -1:*/ ;
2148
2149void sync(void) /*@modifies systemState@*/ ;
2150
2151long int sysconf(int)
2152 /*@modifies errno, systemState@*/
2153 /*:errorcode -1:*/ ;
2154
2155pid_t tcgetpgrp(int)
2156 /*@globals systemState@*/
2157 /*@modifies errno@*/
2158 /*:errorcode -1:*/ ;
2159
2160int tcsetpgrp(int, pid_t)
2161 /*@modifies errno, systemState@*/
2162 /*:errorcode -1:*/ ;
2163
2164int truncate(const char *, off_t)
2165 /*@modifies errno, fileSystem@*/
2166 /*:errorcode -1:*/ ;
2167
2168/*@dependent@*/ /*@null@*/ char *ttyname(int)
2169 /*@globals systemState@*/
2170 /*@modifies errno@*/
2171 /*:errorcode -1:*/ ;
2172
2173int ttyname_r(int, char *name, size_t namesize)
2174 /*@requires maxSet(name) >= (namesize - 1)@*/ ;
2175 /*:errorcode !0:*/ ;
2176
2177useconds_t ualarm(useconds_t, useconds_t)
2178 /*@modifies systemState@*/ ;
2179
2180int unlink(const char *)
2181 /*@modifies fileSystem, errno@*/
2182 /*:errorcode -1:*/ ;
2183
2184int usleep(useconds_t)
2185 /*@modifies fileSystem, errno@*/
2186 /*:errorcode -1:*/ ;
2187
2188pid_t vfork(void)
2189 /*@modifies fileSystem, errno@*/
2190 /*:errorcode -1:*/ ;
2191
2192 /* in posix.h ssize_t write(int, const void *, size_t); */
2193
2194
7272a1c1 2195int chroot (/*@notnull@*/ /*@nullterminated@*/ const char *path)
b87215ab 2196 /*@modifies internalState, errno@*/
2197 /*:errorcode -1:*/
2198 /*@warn superuser "Only super-user processes may call chroot."@*/ ;
7272a1c1 2199
2200int fchroot (int fildes)
2201 /*:statusreturn@*/
2202 /*@warn superuser "Only super-user processes may call fchroot."@*/ ;
1d239d69 2203
b87215ab 2204
1d239d69 2205/*
2206** ctype.h
2207**
2208** evans 2001-08-26 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/ctype.h.html
2209*/
2210
2211# ifdef STRICT
2212lltX_bool isascii(int) /*@*/ ;
2213lltX_bool toascii(int) /*@*/ ;
2214char _toupper(/*@sef@*/ int) /*@*/ ;
2215char _tolower(/*@sef@*/ int) /*@*/ ;
2216# else
2217lltX_bool /*@alt int@*/ isascii(int /*@alt unsigned char@*/) /*@*/ ;
2218lltX_bool /*@alt int@*/ toascii(int /*@alt unsigned char@*/);
2219char /*@alt int@*/ _toupper(/*@sef@*/ int /*@alt unsigned char@*/);
2220char /*@alt int@*/ _tolower(/*@sef@*/ int /*@alt unsigned char@*/);
2221# endif
2222
2223/* other ctype.h functions in ansi.h */
345671f3 2224
2225/*
2226** stdlib.h
2227**
2228** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/drand48.html
2229*/
2230
2231double drand48 (void) /*@modifies internalState@*/ ;
8fe44445 2232double erand48 (unsigned short int /*@-fixedformalarray@*/ xsubi[3] /*@=fixedformalarray@*/ )
2233 /*@modifies internalState@*/ ;
2234
345671f3 2235void srand48 (long int seedval) /*@modifies internalState@*/ ;
2236
2237/*
2238** netinet/in.h
2239**
2240** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xns/netinetin.h.html
2241*/
2242
2243typedef /*@unsignedintegraltype@*/ in_port_t; /* An unsigned integral type of exactly 16 bits. */
2244typedef /*@unsignedintegraltype@*/ in_addr_t; /* An unsigned integral type of exactly 32 bits. */
2245
2a3f24b8 2246/* sa_family_t moved earlier */
345671f3 2247
2248struct in_addr {
2249 in_addr_t s_addr;
2250} ;
2251
2252struct sockaddr_in {
2253 sa_family_t sin_family;
2254 in_port_t sin_port;
2255 struct in_addr sin_addr;
2256 unsigned char sin_zero[8];
2257} ;
2258
2259
2260/* The <netinet/in.h> header defines the following macros for use as values of the level argument of
2261 getsockopt() and setsockopt():
2262 */
2263
2264/*@constant int IPPROTO_IP@*/
2265/*@constant int IPPROTO_ICMP@*/
2266/*@constant int IPPROTO_TCP@*/
2267/*@constant int IPPROTO_UDP@*/
2268
2269/* The <netinet/in.h> header defines the following macros for use as destination addresses for connect(), sendmsg() and sendto():
2270 */
2271
2272/*@constant in_addr_t INADDR_ANY@*/
2273/*@constant in_addr_t INADDR_BROADCAST@*/
2274
8fe44445 2275/*
2276** arpa/inet.h
2277*/
2278
2279in_addr_t htonl (in_addr_t hostlong) /*@*/ ;
2280in_port_t htons (in_port_t hostshort) /*@*/ ;
2281in_addr_t ntohl (in_addr_t netlong) /*@*/ ;
2282in_port_t ntohs (in_port_t netshort) /*@*/ ;
2283
345671f3 2284/*
2285** dirent.h
2286**
2287** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/dirent.h.html
2288*/
2289
8fe44445 2290/*@-redef@*/ /*@-matchfields@*/ /* Has d_ino field, not in posix (?) */
2291
345671f3 2292struct dirent
2293{
2294 ino_t d_ino;
2295 char d_name[];
8fe44445 2296} ;
2297
2298/*@=redef@*/ /*@=matchfields@*/
345671f3 2299
2300typedef /*@abstract@*/ DIR;
2301
8fe44445 2302/*:i32 need to check annotations on these */
2303
345671f3 2304int closedir (DIR *) /*:errorcode -1*/ ;
86d93ed3 2305/*@null@*/ /*@dependent@*/ DIR *opendir(const char *) /*@modifies errno, fileSystem@*/ ;
d5047b91 2306
2307/* in posix.h: struct dirent *readdir(DIR *); */
2308
2309int readdir_r (DIR *, struct dirent *, /*@out@*/ struct dirent **result)
2310 /*@modifies *result@*/
2311 /*:errorcode !0:*/ ;
2312
345671f3 2313void rewinddir(DIR *);
2314void seekdir(DIR *, long int);
2315long int telldir(DIR *);
2316
2317/*drl added these functions
2318 stpcpy and stpncpy are found on linux but
2319 don't seem to be present on other unixes
2320
2321 thanks to Jeff Johnson for pointing out that
2322 these functions were in the unix library
2323*/
2324
2325/* this function is like strcpy but it reutrns a pointer to the null terminated character in dest instead of the beginning of dest */
2326
2327extern char * stpcpy(/*@out@*/ /*@returned@*/ char * dest, const char * src)
2328 /*@modifies *dest @*/
2329 /*@requires maxSet(dest) >= maxRead(src) @*/
2330 /*@ensures MaxRead(dest) == MaxRead (src) /\ MaxRead(result) == 0 /\ MaxSet(result) == ( maxSet(dest) - MaxRead(src) ); @*/;
2331
2332
2333extern char * stpncpy(/*@out@*/ /*@returned@*/ char * dest,
2334 const char * src, size_t n)
2335 /*@modifies *dest @*/
2336 /*@requires MaxSet(dest) >= ( n - 1 ); @*/ /*@ensures MaxRead (src) >= MaxRead(dest) /\ MaxRead (dest) <= n; @*/
2337 ;
2338
ed309918 2339 /* drl added 09-25-001
2340 Alexander Ma pointed out these were missing
2341 */
2342
ccf415d0 2343int usleep (useconds_t useconds) /*@modifies systemState, errno@*/
2344 /*error -1 sucess 0 */
2345 /* warn opengroup unix specification recommends using setitimer(), timer_create(), timer_delete(), timer_getoverrun(), timer_gettime() or
2346 timer_settime() instead of this interface.
2347 */
2348 ;
2349
e5f31c00 2350
2351 /* drl added 10-27-001 */
86d93ed3 2352 /*not sure what the exact size of this is
e5f31c00 2353 also can IPv6 use this function?
2354 */
86d93ed3 2355 /*I'm going to assume that the address had the format:
2356 "###.###.###.###" which is 16 bytes*/
e5f31c00 2357
86d93ed3 2358 /*@kept@*/ char *inet_ntoa(struct in_addr in)
e5f31c00 2359 /*@ensures maxSet(result) <= 15 /\ maxRead(result) <= 15 @*/
2360 ;
2361
2362
ed309918 2363 extern double hypot(double x, double y) /*@modifies errno@*/ /*error errno only*/;
2364
2365
2366 extern double j0(double x) /*@modifies errno @*/ /*error 0 or NaN */;
2367 extern double j1(double x) /*@modifies errno @*/ /*error 0 or NaN */;
2368 extern double jn(int n, double x) /*@modifies errno @*/ /*error 0 or NaN */;
2369
2370 extern double y0(double x) /*@modifies errno @*/ /*error NaN -HUGE_VAL 0.0 */ ;
2371 extern double y1 (double x) /*@modifies errno @*/ /*error NaN -HUGE_VAL 0.0 */;
2372 extern double yn (int n, double x) /*@modifies errno @*/ /*error NaN -HUGE_VAL 0.0 */;
2373
2374 extern double acosh(double x) /*@modifies errno @*/ /*error errno and implementation-dependent(NaN if present) */ /*error NaN and may errno*/;
2375 extern double asinh(double x) /*@modifies errno @*/ /*error NaN and may errno */;
2376
2377 extern double atanh(double x) /*@modifies errno @*/ /*error errno and implementation-dependent(NaN if present) */ /*error NaN and may errno */ ;
2378
2379 extern double lgamma(double x) /*@modifies errno @*/ /*error NaN or HUGE_VAL may set errno */;
2380
2381 extern int signgam ;
2382
2383 extern double erf(double x) /*@modifies errno @*/ /*error NaN or 0 may set errno */;
2384
2385 extern double erfc (double x) /*@modifies errno @*/ /*error NaN or 0
2386 may set errno */;
2387
2388
2389
2390
2391
2392
This page took 0.371244 seconds and 5 git commands to generate.