10 ** evans - 2001-08-27: from http://www.opengroup.org/onlinepubs/007908799/xsh/systypes.h.html
13 typedef /*@integraltype@*/ blkcnt_t;
14 typedef /*@integraltype@*/ blksize_t;
16 /*@-redef@*/ /* These are also defined by ansi.h: */
17 typedef /*@integraltype@*/ clock_t;
18 typedef /*@integraltype@*/ dev_t;
19 typedef /*@integraltype@*/ gid_t;
20 typedef /*@unsignedintegraltype@*/ ino_t;
21 typedef /*@integraltype@*/ mode_t;
22 typedef /*@integraltype@*/ nlink_t;
23 typedef /*@integraltype@*/ off_t;
24 typedef /*@integraltype@*/ pid_t;
25 typedef /*@integraltype@*/ time_t;
26 typedef /*@integraltype@*/ uid_t;
30 typedef /*@integraltype@*/ clockid_t;
31 typedef /*@unsignedintegraltype@*/ fsblkcnt_t;
32 typedef /*@unsignedintegraltype@*/ fsfilcnt_t;
33 typedef /*@integraltype@*/ id_t;
35 typedef /*@integraltype@*/ key_t;
36 typedef /*@integraltype@*/ pthread_attr_t;
37 typedef /*@integraltype@*/ pthread_cond_t;
38 typedef /*@integraltype@*/ pthread_condattr_t;
39 typedef /*@integraltype@*/ pthread_key_t;
40 typedef /*@integraltype@*/ pthread_mutex_t;
41 typedef /*@integraltype@*/ pthread_mutexattr_t;
42 typedef /*@integraltype@*/ pthread_once_t;
43 typedef /*@integraltype@*/ pthread_rwlock_t;
44 typedef /*@integraltype@*/ pthread_rwlockattr_t;
45 typedef /*@integraltype@*/ pthread_t;
46 typedef /*@signedintegraltype@*/ suseconds_t;
47 typedef /*@integraltype@*/ timer_t;
48 typedef /*@unsignedintegraltype@*/ useconds_t;
51 ** Extra stuff in some unixen, not in posix.
54 extern /*@unchecked@*/ int signgam;
56 /*@-redef@*/ /* Defined by ansi: */
57 typedef /*@integraltype@*/ clockid_t;
60 extern void bcopy (char *b1, /*@out@*/ char *b2, int length)
61 /*@modifies *b2@*/ ; /* Yes, the second parameter is the out param! */
63 extern int /*@alt lltX_bool@*/ bcmp (char *b1, char *b2, int length) /*@*/ ;
64 /* Return value is NOT like strcmp! */
66 extern void bzero (/*@out@*/ char *b1, int length) /*@modifies *b1@*/ ;
67 extern int ffs (int i) /*@*/ ;
68 extern int symlink (char *name1, char *name2) /*@modifies fileSystem@*/ ;
71 setvbuf_unlocked (FILE *stream, /*@null@*/ /*@exposed@*/ char *buf,
72 int mode, size_t size)
73 /*@modifies internalState@*/ ;
76 setbuffer (FILE *stream, /*@null@*/ /*@exposed@*/ char *buf, int size)
77 /*@modifies internalState@*/ ;
79 extern void setlinebuf (FILE *stream) /*@modifies internalState@*/ ;
81 extern int strerror_r (int errnum, /*@out@*/ char *strerrbuf, int buflen)
82 /*@modifies strerrbuf@*/ ;
85 fread_unlocked (/*@out@*/ void *ptr, size_t size, size_t nitems,
87 /*@modifies *stream, *ptr;@*/ ;
90 fwrite_unlocked (void *pointer, size_t size, size_t num_items, FILE *stream)
91 /*@modifies *stream;@*/ ;
93 extern void /*@alt void * @*/
94 memccpy (/*@returned@*/ /*@out@*/ void *s1,
95 /*@unique@*/ void *s2, int c, size_t n)
98 extern int strcasecmp (char *s1, char *s2) /*@*/ ;
99 extern int strncasecmp (char *s1, char *s2, int n) /*@*/ ;
100 extern /*@null@*/ /*@only@*/ char *strdup (char *s) /*@*/ ;
102 extern /*@null@*/ /*@dependent@*/ char *
103 index (/*@returned@*/ char *s, char c) /*@*/ ;
105 extern /*@null@*/ /*@dependent@*/ char *
106 rindex (/*@returned@*/ char *s, char c) /*@*/ ;
109 extern double cbrt (double x) /*@modifies errno@*/ ;
110 extern double rint (double x) /*@*/ ;
111 extern double trunc (double x) /*@*/ ;
113 /*@constant int ENOTBLK@*/
114 /*@constant int ETXTBSY@*/
115 /*@constant int EWOULDBLOCK@*/
116 /*@constant int EINPROGRESS@*/
117 /*@constant int EALREADY@*/
118 /*@constant int ENOTSOCK@*/
119 /*@constant int EDESTADDRREQ@*/
120 /*@constant int EMSGSIZE@*/
121 /*@constant int EPROTOTYPE@*/
122 /*@constant int ENOPROTOOPT@*/
123 /*@constant int EPROTONOSUPPORT@*/
124 /*@constant int ESOCKTNOSUPPORT@*/
125 /*@constant int EOPNOTSUPP@*/
126 /*@constant int EPFNOSUPPORT@*/
127 /*@constant int EAFNOSUPPORT@*/
128 /*@constant int EADDRINUSE@*/
129 /*@constant int EADDRNOTAVAIL@*/
130 /*@constant int ENETDOWN@*/
131 /*@constant int ENETUNREACH@*/
132 /*@constant int ENETRESET@*/
133 /*@constant int ECONNABORTED@*/
134 /*@constant int ECONNRESET@*/
135 /*@constant int ENOBUFS@*/
136 /*@constant int EISCONN@*/
137 /*@constant int ENOTCONN@*/
138 /*@constant int ESHUTDOWN@*/
139 /*@constant int ETOOMANYREFS@*/
140 /*@constant int ETIMEDOUT@*/
141 /*@constant int ECONNREFUSED@*/
142 /*@constant int ENAMETOOLONG@*/
143 /*@constant int EHOSTDOWN@*/
144 /*@constant int EHOSTUNREACH@*/
145 /*@constant int ENOTEMPTY@*/
146 /*@constant int EPROCLIM@*/
147 /*@constant int EUSERS@*/
148 /*@constant int EDQUOT@*/
149 /*@constant int ESTALE@*/
150 /*@constant int EREMOTE@*/
151 /*@constant int ENOMSG@*/
152 /*@constant int EIDRM@*/
153 /*@constant int EALIGN@*/
154 /*@constant int EDEADLK@*/
155 /*@constant int ENOLCK@*/
156 /*@constant int ENOSYS@*/
157 /*@constant int EACTIVE@*/
158 /*@constant int ENOACTIVE@*/
159 /*@constant int ENORESOURCES@*/
160 /*@constant int ENOSYSTEM@*/
161 /*@constant int ENODUST@*/
162 /*@constant int EDUPNOCONN@*/
163 /*@constant int EDUPNODISCONN@*/
164 /*@constant int EDUPNOTCNTD@*/
165 /*@constant int EDUPNOTIDLE@*/
166 /*@constant int EDUPNOTWAIT@*/
167 /*@constant int EDUPNOTRUN@*/
168 /*@constant int EDUPBADOPCODE@*/
169 /*@constant int EDUPINTRANSIT@*/
170 /*@constant int EDUPTOOMANYCPUS@*/
171 /*@constant int ELOOP@*/
173 /*@constant int LOCK_MAX@*/
174 /*@constant int FCHR_MAX@*/
175 /*@constant int USI_MAX@*/
176 /*@constant int WORD_BIT@*/
177 /*@constant int LONG_BIT@*/
179 /*@-incondefs@*/ /* some constant are also declared in posix.h*/
181 /*@constant long NAME_MAX@*/
183 /*@constant long NGROUPS_MAX@*/
185 /*@constant long MAX_CANON@*/
186 /*@constant int MAX_CHAR@*/
187 /*@constant long OPEN_MAX@*/
188 /*@constant int PASS_MAX@*/
190 /*@constant int PID_MAX@*/
191 /*@constant int SYSPID_MAX@*/
192 /*@constant long PIPE_BUF@*/
194 /*@constant int PIPE_MAX@*/
195 /*@constant int PROC_MAX@*/
196 /*@constant int STD_BLK@*/
197 /*@constant int SYS_NMLN@*/
198 /*@constant int SYS_OPEN@*/
199 /*@constant int NZERO@*/
200 /*@constant int UID_MAX@*/
201 /*@constant long MB_LEN_MAX@*/
202 /*@constant int NL_ARGMAX@*/
203 /*@constant int NL_MSGMAX@*/
204 /*@constant int NL_NMAX@*/
205 /*@constant int NL_SETMAX@*/
206 /*@constant int NL_TEXTMAX@*/
207 /*@constant int NL_LBLMAX@*/
208 /*@constant int NL_LANGMAX @*/
210 /*@constant double M_E@*/
211 /*@constant double M_LOG2E@*/
212 /*@constant double M_LOG10E@*/
213 /*@constant double M_LN2@*/
214 /*@constant double M_LN10@*/
215 /*@constant double M_PI@*/
216 /*@constant double M_PI_2@*/
217 /*@constant double M_PI_4@*/
218 /*@constant double M_1_PI@*/
219 /*@constant double M_2_PI@*/
220 /*@constant double M_2_SQRTPI@*/
221 /*@constant double M_SQRT2@*/
222 /*@constant double M_SQRT1_2@*/
224 /*@constant double MAXFLOAT@*/
225 /*@constant double HUGE@*/
227 /*@constant int DOMAIN@*/
228 /*@constant int SING@*/
229 /*@constant int OVERFLOW@*/
230 /*@constant int UNDERFLOW@*/
231 /*@constant int TLOSS@*/
232 /*@constant int PLOSS@*/
234 extern /*@unchecked@*/ int daylight;
235 extern /*@unchecked@*/ long timezone;
236 extern /*@unchecked@*/ char *tzname[];
239 extern void tzset(void) /*@modifies daylight, timezone, tzname@*/ ;
242 /*@-redef@*/ /* Defined by ansi: */
243 typedef /*@integraltype@*/ key_t;
244 /*@-incondefs@*/ typedef long timer_t; /*@=incondefs@*/
247 typedef unsigned char uchar_t;
248 typedef unsigned short ushort_t;
249 typedef unsigned int uint_t;
250 typedef unsigned long ulong_t;
251 typedef volatile unsigned char vuchar_t;
252 typedef volatile unsigned short vushort_t;
253 typedef volatile unsigned int vuint_t;
254 typedef volatile unsigned long vulong_t;
255 typedef long label_t;
257 typedef /*@integraltype@*/ daddr_t;
258 typedef char *caddr_t;
259 typedef long *qaddr_t;
260 typedef char *addr_t;
261 typedef long physadr_t;
264 typedef unsigned long rlim_t;
267 typedef char slab_t[12];
268 typedef ulong_t shmatt_t;
269 typedef ulong_t msgqnum_t;
270 typedef ulong_t msglen_t;
271 typedef uchar_t uchar;
272 typedef ushort_t ushort;
274 typedef ulong_t ulong;
275 typedef uchar_t u_char;
276 typedef ushort_t u_short;
277 typedef uint_t u_int;
278 typedef ulong_t u_long;
279 typedef vuchar_t vu_char;
280 typedef vushort_t vu_short;
281 typedef vuint_t vu_int;
282 typedef vulong_t vu_long;
283 typedef long swblk_t;
284 typedef u_long fixpt_t;
285 typedef long segsz_t;
286 typedef /*@abstract@*/ fd_set;
288 int ioctl (int d, int /*@alt long@*/ request, /*@out@*/ void *arg)
289 /*@modifies *arg, errno@*/ ; /* depends on request! */
291 pid_t vfork (void) /*@modifies fileSystem@*/ ;
299 /*@constant int UIO_MAXIOV@*/ /* BSD */
300 /*@constant int IOV_MAX@*/ /* supposedly SVR4 */
303 readv (int fd, const struct iovec iov[], int iovcnt)
304 /*@modifies iov[].iov_base, fileSystem, errno@*/;
307 writev (int fd, const struct iovec iov[], int iovcnt)
308 /*@modifies errno@*/;
310 /*________________________________________________________________________
320 /*@constant short POLLIN@*/
321 /*@constant short POLLRDNORM@*/
322 /*@constant short POLLRDBAND@*/
323 /*@constant short POLLPRI@*/
324 /*@constant short POLLOUT@*/
325 /*@constant short POLLWRNORM@*/
326 /*@constant short POLLWRBAND@*/
327 /*@constant short POLLERR@*/
328 /*@constant short POLLHUP@*/
329 /*@constant short POLLNVAL@*/
331 extern int poll (struct poll pollfd[], unsigned long nfds, int timeout)
332 /*@modifies pollfd[].revents, errno@*/ ;
335 ** free does not take null
339 extern void free (/*@notnull@*/ /*@out@*/ /*@only@*/ void *p) /*@modifies *p@*/ ;
342 /*________________________________________________________________________
346 /*@constant int SOCK_STREAM@*/
347 /*@constant int SOCK_DGRAM@*/
348 /*@constant int SOCK_RAW@*/
349 /*@constant int SOCK_RDM@*/
350 /*@constant int SOCK_SEQPACKET@*/
351 /*@constant int SO_DEBUG@*/
352 /*@constant int SO_ACCEPTCONN@*/
353 /*@constant int SO_REUSEADDR@*/
354 /*@constant int SO_KEEPALIVE@*/
355 /*@constant int SO_DONTROUTE@*/
356 /*@constant int SO_BROADCAST@*/
357 /*@constant int SO_USELOOPBACK@*/
358 /*@constant int SO_LINGER@*/
359 /*@constant int SO_OOBINLINE@*/
360 /*@constant int SO_REUSEPORT@*/
361 /*@constant int SO_SNDBUF@*/
362 /*@constant int SO_RCVBUF@*/
363 /*@constant int SO_SNDLOWAT@*/
364 /*@constant int SO_RCVLOWAT@*/
365 /*@constant int SO_SNDTIMEO@*/
366 /*@constant int SO_RCVTIMEO@*/
367 /*@constant int SO_ERROR@*/
368 /*@constant int SO_TYPE@*/
369 /*@constant int SOL_SOCKET@*/
370 /*@constant int AF_UNSPEC@*/
371 /*@constant int AF_LOCAL@*/
372 /*@constant int AF_UNIX@*/
373 /*@constant int AF_INET@*/
374 /*@constant int AF_IMPLINK@*/
375 /*@constant int AF_PUP@*/
376 /*@constant int AF_CHAOS@*/
377 /*@constant int AF_NS@*/
378 /*@constant int AF_ISO@*/
379 /*@constant int AF_OSI@*/
380 /*@constant int AF_ECMA@*/
381 /*@constant int AF_DATAKIT@*/
382 /*@constant int AF_CCITT@*/
383 /*@constant int AF_SNA@*/
384 /*@constant int AF_DECnet@*/
385 /*@constant int AF_DLI@*/
386 /*@constant int AF_LAT@*/
387 /*@constant int AF_HYLINK@*/
388 /*@constant int AF_APPLETALK@*/
389 /*@constant int AF_ROUTE@*/
390 /*@constant int AF_LINK@*/
391 /*@constant int pseudo_AF_XTP@*/
392 /*@constant int AF_COIP@*/
393 /*@constant int AF_CNT@*/
394 /*@constant int pseudo_AF_RTIP@*/
395 /*@constant int AF_IPX@*/
396 /*@constant int AF_SIP@*/
397 /*@constant int pseudo_AF_PIP@*/
398 /*@constant int AF_ISDN@*/
399 /*@constant int AF_E164@*/
400 /*@constant int AF_MAX@*/
401 /*@constant int MSG_OOB@*/
402 /*@constant int MSG_PEEK@*/
403 /*@constant int MSG_DONTROUTE@*/
404 /*@constant int MSG_EOR@*/
405 /*@constant int MSG_TRUNC@*/
406 /*@constant int MSG_CTRUNC@*/
407 /*@constant int MSG_WAITALL@*/
408 /*@constant int MSG_DONTWAIT@*/
409 /*@constant int MSG_EOF@*/
410 /*@constant int MSG_COMPAT@*/
411 /*@constant int PF_UNSPEC@*/
412 /*@constant int PF_LOCAL@*/
413 /*@constant int PF_UNIX@*/
414 /*@constant int PF_INET@*/
415 /*@constant int PF_IMPLINK@*/
416 /*@constant int PF_PUP@*/
417 /*@constant int PF_CHAOS@*/
418 /*@constant int PF_NS@*/
419 /*@constant int PF_ISO@*/
420 /*@constant int PF_OSI@*/
421 /*@constant int PF_ECMA@*/
422 /*@constant int PF_DATAKIT@*/
423 /*@constant int PF_CCITT@*/
424 /*@constant int PF_SNA@*/
425 /*@constant int PF_DECnet@*/
426 /*@constant int PF_DLI@*/
427 /*@constant int PF_LAT@*/
428 /*@constant int PF_HYLINK@*/
429 /*@constant int PF_APPLETALK@*/
430 /*@constant int PF_ROUTE@*/
431 /*@constant int PF_LINK@*/
432 /*@constant int PF_XTP@*/
433 /*@constant int PF_COIP@*/
434 /*@constant int PF_CNT@*/
435 /*@constant int PF_SIP@*/
436 /*@constant int PF_IPX@*/
437 /*@constant int PF_RTIP@*/
438 /*@constant int PF_PIP@*/
439 /*@constant int PF_ISDN@*/
440 /*@constant int PF_MAX@*/
441 /*@constant int NET_MAXID@*/
442 /*@constant int NET_RT_DUMP@*/
443 /*@constant int NET_RT_FLAGS@*/
444 /*@constant int NET_RT_IFLIST@*/
445 /*@constant int NET_RT_MAXID@*/
446 /*@constant int SOMAXCONN@*/
447 /*@constant int SCM_RIGHTS@*/
450 u_char sa_len; /* total length */
451 u_char sa_family; /* address family */
452 char sa_data[14]; /* actually longer; address value */
456 int l_onoff; /* option on/off */
457 int l_linger; /* linger time */
461 u_short sp_family; /* address family */
462 u_short sp_protocol; /* protocol */
465 caddr_t msg_name; /* optional address */
466 u_int msg_namelen; /* size of address */
467 struct iovec *msg_iov; /* scatter/gather array */
468 u_int msg_iovlen; /* # elements in msg_iov */
469 caddr_t msg_control; /* ancillary data, see below */
470 u_int msg_controllen; /* ancillary data buffer len */
471 int msg_flags; /* flags on received message */
475 u_int cmsg_len; /* data byte count, including hdr */
476 int cmsg_level; /* originating protocol */
477 int cmsg_type; /* protocol-specific type */
478 /* followed by u_char cmsg_data[]; */
482 accept (int s, struct sockaddr *addr, int *addrlen)
483 /*@modifies *addrlen, errno@*/;
486 bind (int s, struct sockaddr *name, int namelen)
487 /*@modifies errno, fileSystem@*/;
490 connect (int s, struct sockaddr *name, int namelen)
491 /*@modifies errno, internalState@*/;
493 int getpeername (int s, /*@out@*/ struct sockaddr *name, size_t *namelen)
494 /*@modifies *name, *namelen, errno@*/;
496 typedef /*@unsignedintegraltype@*/ socklen_t;
500 int getsockname (int s, /*@out@*/ struct sockaddr *address, socklen_t *address_len)
501 /*@i556@*/ /*: can't do this? requires maxSet(address) >= (*address_len) @*/
502 /*@modifies *address, *address_len, errno@*/;
505 int getsockname (int s, /*@out@*/ struct sockaddr *address, socklen_t /*@alt size_t@*/ *address_len)
506 /*@i556@*/ /*: can't do this? requires maxSet(address) >= (*address_len) @*/
507 /*@modifies *address, *address_len, errno@*/;
511 int getsockopt (int s, int level, int optname, /*@out@*/ void *optval, size_t *optlen)
512 /*@modifies *optval, *optlen, errno@*/;
515 listen (int s, int backlog)
516 /*@modifies errno, internalState@*/;
519 recv (int s, /*@out@*/ void *buf, size_t len, int flags)
520 /*@modifies *buf, errno@*/;
523 recvfrom (int s, void *buf, size_t len, int flags, /*@null@*/ struct sockaddr *from, int *fromlen)
524 /*@modifies *buf, *from, *fromlen, errno@*/;
527 recvmsg (int s, struct msghdr *msg, int flags)
528 /*@modifies msg->msg_iov->iov_base[], errno@*/;
531 send (int s, const void *msg, size_t len, int flags)
532 /*@modifies errno@*/;
535 sendto (int s, const void *msg, size_t len, int flags, const struct sockaddr *to, int tolen)
536 /*@modifies errno@*/;
539 sendmsg (int s, const struct msghdr *msg, int flags)
540 /*@modifies errno@*/;
543 setsockopt (int s, int level, int optname, const void *optval, int optlen)
544 /*@modifies internalState, errno@*/;
547 shutdown (int s, int how)
548 /*@modifies errno@*/;
551 socket (int domain, int type, int protocol)
552 /*@modifies errno@*/;
555 socketpair (int d, int type, int protocol, /*@out@*/ int *sv)
556 /*@modifies errno@*/;
558 /*@constant int BADSIG@*/
559 /*@constant int SA_ONSTACK@*/
560 /*@constant int SA_RESTART@*/
561 /*@constant int SA_DISABLE@*/
562 /*@constant int SIGBUS@*/
563 /*@constant int SIGEMT@*/
564 /*@constant int SIGINFO@*/
565 /*@constant int SIGIO@*/
566 /*@constant int SIGIOT@*/
567 /*@constant int SIGPOLL@*/
568 /*@constant int SIGPROF@*/
569 /*@constant int SIGPWR@*/
570 /*@constant int SIGSYS@*/
571 /*@constant int SIGTRAP@*/
572 /*@constant int SIGURG@*/
573 /*@constant int SIGVTALRM@*/
574 /*@constant int SIGWINCH@*/
575 /*@constant int SIGXCPU@*/
576 /*@constant int SIGXFSZ@*/
578 extern void psignal (int sig, const char *msg)
579 /*@modifies fileSystem@*/;
582 setenv (const char *name, const char *value, int overwrite)
583 /*@globals environ@*/
584 /*@modifies *environ, errno@*/;
587 unsetenv (const char *name)
588 /*@globals environ@*/
589 /*@modifies *environ@*/;
591 /*________________________________________________________________________
600 W_EXITCODE (int ret, int sig)
607 /*@constant int WAIT_ANY@*/
608 /*@constant int WAIT_MYPGRP@*/
609 /*@constant int WSTOPPED@*/
612 wait3 (int *statloc, int options, /*@null@*/ /*@out@*/ struct rusage *rusage)
613 /*@modifies *statloc, *rusage, errno@*/;
616 wait4 (pid_t p, int *statloc, int opt, /*@null@*/ /*@out@*/ struct rusage *r)
617 /*@modifies *statloc, *r, errno@*/;
634 /*@constant int DST_NONE@*/
635 /*@constant int DST_USA@*/
636 /*@constant int DST_AUST@*/
637 /*@constant int DST_WET@*/
638 /*@constant int DST_MET@*/
639 /*@constant int DST_EET@*/
640 /*@constant int DST_CAN@*/
642 /*@constant int ITIMER_PROF@*/
643 /*@constant int ITIMER_REAL@*/
644 /*@constant int ITIMER_VIRTUAL@*/
647 struct timeval it_interval;
648 struct timeval it_value;
659 adjtime (const struct timeval *delta, /*@null@*/ /*@out@*/ struct timeval *olddelta)
660 /*@modifies internalState, *olddelta, errno@*/;
663 getitimer (int which, /*@out@*/ struct itimerval *value)
664 /*@modifies errno, *value*/;
667 gettimeofday (/*@null@*/ /*@out@*/ struct timeval *tp, /*@null@*/ /*@out@*/ struct timezone *tzp)
668 /*@modifies *tp, *tzp, errno@*/;
671 setitimer (int which, struct itimerval *val, /*@null@*/ /*@out@*/ struct itimerval *oval)
672 /*@modifies *oval, errno, internalState*/;
675 settimeofday (const struct timeval *t, const struct timezone *z)
676 /*@modifies internalState, errno@*/;
679 utimes (const char *file, /*@null@*/ const struct timeval *times)
680 /*@modifies fileSystem, errno*/;
682 /*________________________________________________________________________
686 /*@constant int PROT_READ@*/
687 /*@constant int PROT_WRITE@*/
688 /*@constant int PROT_EXEC@*/
689 /*@constant int MAP_SHARED@*/
690 /*@constant int MAP_PRIVATE@*/
691 /*@constant int MAP_COPY@*/
692 /*@constant int MAP_FIXED@*/
693 /*@constant int MAP_RENAME@*/
694 /*@constant int MAP_NORESERVE@*/
695 /*@constant int MAP_INHERIT@*/
696 /*@constant int MAP_NOEXTEND@*/
697 /*@constant int MAP_HASSEMAPHORE@*/
698 /*@constant int MS_ASYNC@*/
699 /*@constant int MS_INVALIDATE@*/
700 /*@constant int MAP_FILE@*/
701 /*@constant int MAP_ANON@*/
702 /*@constant int MADV_NORMAL@*/
703 /*@constant int MADV_RANDOM@*/
704 /*@constant int MADV_SEQUENTIAL@*/
705 /*@constant int MADV_WILLNEED@*/
706 /*@constant int MADV_DONTNEED@*/
709 mmap (/*@null@*/ /*@returned@*/ caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
713 madvise (caddr_t addr, int len, int behav)
717 mprotect (caddr_t addr, int len, int prot)
721 int munmap (/*@only@*/ caddr_t addr, size_t len)
722 /*@modifies fileSystem, *addr, errno @*/;
725 msync (caddr_t addr, int len, int flags)
729 mlock (caddr_t addr, size_t len)
733 munlock (caddr_t addr, size_t len)
737 /*________________________________________________________________________
742 unsigned short ws_row;
743 unsigned short ws_col;
744 unsigned short ws_xpixel;
745 unsigned short ws_ypixel;
748 /*@constant int TIOCMODG@*/
749 /*@constant int TIOCMODS@*/
750 /*@constant int TIOCM_LE@*/
751 /*@constant int TIOCM_DTR@*/
752 /*@constant int TIOCM_RTS@*/
753 /*@constant int TIOCM_ST@*/
754 /*@constant int TIOCM_SR@*/
755 /*@constant int TIOCM_CTS@*/
756 /*@constant int TIOCM_CAR@*/
757 /*@constant int TIOCM_CD@*/
758 /*@constant int TIOCM_RNG@*/
759 /*@constant int TIOCM_RI@*/
760 /*@constant int TIOCM_DSR@*/
761 /*@constant int TIOCEXCL@*/
762 /*@constant int TIOCNXCL@*/
763 /*@constant int TIOCFLUSH@*/
764 /*@constant int TIOCGETA@*/
765 /*@constant int TIOCSETA@*/
766 /*@constant int TIOCSETAW@*/
767 /*@constant int TIOCSETAF@*/
768 /*@constant int TIOCGETD@*/
769 /*@constant int TIOCSETD@*/
770 /*@constant int TIOCSBRK@*/
771 /*@constant int TIOCCBRK@*/
772 /*@constant int TIOCSDTR@*/
773 /*@constant int TIOCCDTR@*/
774 /*@constant int TIOCGPGRP@*/
775 /*@constant int TIOCSPGRP@*/
776 /*@constant int TIOCOUTQ@*/
777 /*@constant int TIOCSTI@*/
778 /*@constant int TIOCNOTTY@*/
779 /*@constant int TIOCPKT@*/
780 /*@constant int TIOCPKT_DATA@*/
781 /*@constant int TIOCPKT_FLUSHREAD@*/
782 /*@constant int TIOCPKT_FLUSHWRITE@*/
783 /*@constant int TIOCPKT_STOP@*/
784 /*@constant int TIOCPKT_START@*/
785 /*@constant int TIOCPKT_NOSTOP@*/
786 /*@constant int TIOCPKT_DOSTOP@*/
787 /*@constant int TIOCPKT_IOCTL@*/
788 /*@constant int TIOCSTOP@*/
789 /*@constant int TIOCSTART@*/
790 /*@constant int TIOCMSET@*/
791 /*@constant int TIOCMBIS@*/
792 /*@constant int TIOCMBIC@*/
793 /*@constant int TIOCMGET@*/
794 /*@constant int TIOCREMOTE@*/
795 /*@constant int TIOCGWINSZ@*/
796 /*@constant int TIOCSWINSZ@*/
797 /*@constant int TIOCUCNTL@*/
798 /*@constant int TIOCSTAT@*/
799 /*@constant int TIOCCONS@*/
800 /*@constant int TIOCSCTTY@*/
801 /*@constant int TIOCEXT@*/
802 /*@constant int TIOCSIG@*/
803 /*@constant int TIOCDRAIN@*/
804 /*@constant int TIOCMSDTRWAIT@*/
805 /*@constant int TIOCMGDTRWAIT@*/
806 /*@constant int TIOCTIMESTAMP@*/
807 /*@constant int TIOCSDRAINWAIT@*/
808 /*@constant int TIOCGDRAINWAIT@*/
809 /*@constant int TTYDISC@*/
810 /*@constant int TABLDISC@*/
811 /*@constant int SLIPDISC@*/
812 /*@constant int PPPDISC@*/
814 /*@constant int MAXHOSTNAMELEN@*/
817 FD_CLR (int n, fd_set *p)
821 FD_COPY (fd_set *f, /*@out@*/ fd_set *t)
824 extern int /*@alt lltX_bool@*/
825 FD_ISSET (int n, fd_set *p)
829 FD_SET (int n, fd_set *p)
833 FD_ZERO (fd_set /*@out@*/ *p)
838 /*@modifies internalState, errno@*/;
841 fchown (int fd, uid_t owner, gid_t group)
842 /*@modifies errno, fileSystem@*/;
846 /*@modifies errno, fileSystem@*/;
849 ftruncate (int fd, off_t length)
850 /*@modifies errno, fileSystem@*/;
852 int gethostname (/*@out@*/ char *address, size_t address_len)
854 /*@modifies address@*/ ;
856 int initgroups (const char *name, int basegid)
857 /*@modifies internalState@*/;
860 lchown (const char *path, uid_t owner, gid_t group)
861 /*@modifies errno, fileSystem@*/;
864 select (int mfd, fd_set /*@null@*/ *r, fd_set /*@null@*/ *w, fd_set /*@null@*/ *e, struct timeval *t)
865 /*@modifies *r, *w, *e, *t, errno@*/;
869 /*@modifies errno, internalState@*/;
873 /*@modifies errno, internalState@*/;
876 setgroups (int ngroups, const gid_t *gidset)
877 /*@modifies errno, internalState@*/;
880 setregid (gid_t rgid, gid_t egid)
881 /*@modifies errno, internalState@*/;
884 setreuid (gid_t ruid, gid_t euid)
885 /*@modifies errno, internalState@*/;
889 /*@modifies fileSystem@*/;
892 symlink (const char *path, const char *path2)
893 /*@modifies fileSystem@*/;
896 truncate (const char *name, off_t length)
897 /*@modifies errno, fileSystem@*/;
899 /*@constant int EBADRPC@*/
900 /*@constant int ERPCMISMATCH@*/
901 /*@constant int EPROGUNAVAIL@*/
902 /*@constant int EPROGMISMATCH@*/
903 /*@constant int EPROCUNAVAIL@*/
904 /*@constant int EFTYPE@*/
905 /*@constant int EAUTH@*/
906 /*@constant int ENEEDAUTH@*/
907 /*@constant int ELAST@*/
913 /*@unchecked@*/ extern char *TMAGIC;
914 /*@constant int TMAGLEN@*/
915 /*@unchecked@*/ extern char *TVERSION;
916 /*@constant int TVERSLEN@*/
918 /*@constant int REGTYPE@*/
919 /*@constant int AREGTYPE@*/
920 /*@constant int LNKTYPE@*/
921 /*@constant int SYMTYPE@*/
922 /*@constant int CHRTYPE@*/
923 /*@constant int BLKTYPE@*/
924 /*@constant int DIRTYPE@*/
925 /*@constant int FIFOTYPE@*/
926 /*@constant int CONTTYPE@*/
928 /*@constant int TSUID@*/
929 /*@constant int TSGID@*/
930 /*@constant int TSVTX@*/
932 /*@constant int TUREAD@*/
933 /*@constant int TUWRITE@*/
934 /*@constant int TUEXEC@*/
935 /*@constant int TGREAD@*/
936 /*@constant int TGWRITE@*/
937 /*@constant int TGEXEC@*/
938 /*@constant int TOREAD@*/
939 /*@constant int TOWRITE@*/
940 /*@constant int TOEXEC@*/
943 uid_t uid; /* user id */
944 gid_t gid; /* group id */
945 uid_t cuid; /* creator user id */
946 gid_t cgid; /* creator group id */
947 mode_t mode; /* r/w permission */
948 ulong seq; /* slot usage sequence number */
949 key_t key; /* user specified msg/sem/shm key */
952 /*@constant int IPC_R@*/
953 /*@constant int IPC_W@*/
954 /*@constant int IPC_M@*/
955 /*@constant int IPC_CREAT@*/
956 /*@constant int IPC_EXCL@*/
957 /*@constant int IPC_NOWAIT@*/
958 /*@constant key_t IPC_PRIVATE@*/
959 /*@constant int IPC_RMID@*/
960 /*@constant int IPC_SET@*/
961 /*@constant int IPC_STAT@*/
968 struct ipc_perm msg_perm; /* msg queue permission bits */
969 struct msg *msg_first; /* first message in the queue */
970 struct msg *msg_last; /* last message in the queue */
971 u_long msg_cbytes; /* number of bytes in use on the queue */
972 u_long msg_qnum; /* number of msgs in the queue */
973 u_long msg_qbytes; /* max # of bytes on the queue */
974 pid_t msg_lspid; /* pid of last msgsnd() */
975 pid_t msg_lrpid; /* pid of last msgrcv() */
976 time_t msg_stime; /* time of last msgsnd() */
977 time_t msg_rtime; /* time of last msgrcv() */
978 time_t msg_ctime; /* time of last msgctl() */
982 long mtype; /* message type (+ve integer) */
983 char mtext[]; /* message body */
986 /*@constant int MSG_NOERROR@*/
987 /*@constant int MSGMAX@*/
988 /*@constant int MSGMNB@*/
989 /*@constant int MSGMNI@*/
990 /*@constant int MSGTQL@*/
993 msgctl (int id , int cmd, /*@out@*/ struct msqid_ds *buf)
994 /*@modifies errno, *buf@*/;
997 msgget (key_t key, int flag)
998 /*@modifies errno@*/;
1001 msgrcv (int id, /*@out@*/ void *ptr, size_t nbytes, long type, int flags)
1002 /*@modifies errno, *ptr@*/;
1005 msgsnd (int id, const void *ptr, size_t nbytes, int flag)
1006 /*@modifies errno@*/;
1013 struct ipc_perm sem_perm;
1014 struct sem *sem_base;
1029 struct semid_ds *buf;
1039 /*@constant int SEM_A@*/
1040 /*@constant int SEMAEM@*/
1041 /*@constant int SEMMNI@*/
1042 /*@constant int SEMMNS@*/
1043 /*@constant int SEMMNU@*/
1044 /*@constant int SEMMSL@*/
1045 /*@constant int SEMOPN@*/
1046 /*@constant int SEM_R@*/
1047 /*@constant int SEMUME@*/
1048 /*@constant int SEM_UNDO@*/
1049 /*@constant int SEMVMX@*/
1050 /*@constant int GETVAL@*/
1051 /*@constant int SETVAL@*/
1052 /*@constant int GETPID@*/
1053 /*@constant int GETNCNT@*/
1054 /*@constant int GETZCNT@*/
1055 /*@constant int GETALL@*/
1056 /*@constant int SETALL@*/
1058 /*@constant int ERMID@*/
1061 semctl (int id, int semnum, int cmd, union semun arg)
1062 /*@modifies errno@*/;
1065 semget (key_t key, int nsems, int flag)
1066 /*@modifies errno@*/;
1069 semop (int id, struct sembuf *semoparray, size_t nops)
1070 /*@modifies errno@*/;
1077 struct ipc_perm shm_perm;
1089 /*@constant int SHMLBA@*/
1090 /*@constant int SHM_LOCK@*/
1091 /*@constant int SHMMAX@*/
1092 /*@constant int SHMMIN@*/
1093 /*@constant int SHMMNI@*/
1094 /*@constant int SHM_R@*/
1095 /*@constant int SHM_RDONLY@*/
1096 /*@constant int SHM_RND@*/
1097 /*@constant int SHMSEG@*/
1098 /*@constant int SHM_W@*/
1099 /*@constant int SHM_UNLOCK@*/
1101 void * shmat (int id, /*@null@*/ void *addr, int flag)
1102 /*@modifies errno@*/ ;
1104 extern int shmctl (int id, int cmd, /*@out@*/ struct shmid_ds *buf)
1105 /*@modifies errno, *buf@*/ ;
1107 extern int shmdt (void *addr)
1108 /*@modifies errno@*/ ;
1110 extern int shmget (key_t key, int size, int flag)
1111 /*@modifies errno@*/ ;
1115 ** this is in stdio.h!
1123 ** evans 2001-12-30: added from http://www.opengroup.org/onlinepubs/007908799/xsh/stdio.h.html
1126 /*@constant unsignedintegraltype BUFSIZ@*/
1127 /*@constant unsignedintegraltype FILENAME_MAX@*/
1128 /*@constant unsignedintegraltype FOPEN_MAX@*/
1129 /*@constant bool _IOFBF@*/
1130 /*@constant bool _IOLBF@*/
1131 /*@constant bool _IONBF@*/
1132 /*@constant unsignedintegraltype L_ctermid@*/
1133 /*@constant unsignedintegraltype L_cuserid@*/
1134 /*@constant unsignedintegraltype L_tmpnam@*/
1135 /*@constant unsignedintegraltype SEEK_CUR@*/
1136 /*@constant unsignedintegraltype SEEK_END@*/
1137 /*@constant unsignedintegraltype SEEK_SET@*/
1138 /*@constant unsignedintegraltype TMP_MAX@*/
1143 /*@constant observer char *P_tmpdir@*/
1145 void clearerr (FILE *s)
1148 /*@dependent@*/ char *ctermid (/*@returned@*/ /*@null@*/ char *) /*@*/ ;
1149 /* Result may be static pointer if parameter is NULL, otherwise is fresh. */
1151 char *cuserid (/*@null@*/ /*@returned@*/ char *)
1152 /*@warn legacy "cuserid is obsolete"@*/ /*@*/ ;
1154 /* fclose in standard.h */
1156 /*@null@*/ FILE *fdopen (int, const char *)
1157 /*@modifies errno, fileSystem@*/ ;
1159 /* feof, ferror fflush, fgetc, fgetpos, fgets - in standard.h */
1161 int fileno (/*@notnull@*/ FILE *)
1163 /*@modifies errno@*/ ;
1165 void flockfile (/*@notnull@*/ FILE *f)
1166 /*@modifies f, fileSystem@*/ ;
1168 int fseeko (FILE *stream, off_t offset, int whence)
1170 /*@modifies stream, errno@*/ ;
1172 off_t ftello(FILE *stream)
1173 /*:errorcode -1:*/ /*@modifies errno*/ ;
1175 int ftrylockfile(FILE *stream)
1177 /*@modifies stream, fileSystem, errno*/ ;
1179 void funlockfile (FILE *stream)
1180 /*@modifies stream, fileSystem*/ ;
1182 int getc_unlocked(FILE *stream)
1183 /*@warn multithreaded "getc_unlocked is a thread unsafe version of getc"@*/
1184 /*@modifies *stream, fileSystem, errno@*/ ;
1186 int getchar_unlocked (void)
1187 /*@warn multithreaded "getchar_unlocked is a thread unsafe version of getchar"@*/
1189 /*@modifies *stdin, fileSystem@*/ ;
1191 int getopt (int, char * const[], const char)
1194 int getw (FILE *stream)
1196 /*@modifies fileSystem, *stream, errno@*/ ;
1198 int pclose(FILE *stream)
1200 /*@modifies *stream, errno@*/ ;
1202 /*@null@*/ FILE *popen (const char *command, const char *mode)
1203 /*:errorcode NULL:*/
1204 /*@modifies fileSystem, errno@*/ ;
1206 int putc_unlocked (int, FILE *stream)
1207 /*@warn multithreaded "putc_unlocked is a thread unsafe version of putc"@*/
1209 /*@modifies fileSystem, *stream, errno@*/ ;
1211 int putchar_unlocked(int)
1212 /*@warn multithreaded "putchar_unlocked is a thread unsafe version of putchar"@*/
1214 /*@modifies fileSystem, *stdout, errno@*/ ;
1216 int putw(int, FILE *stream)
1218 /*@modifies fileSystem, *stdout, errno@*/ ;
1220 int remove (const char *)
1221 /*@modifies fileSystem@*/ ;
1223 int rename (const char *, const char *)
1224 /*@modifies fileSystem@*/ ;
1226 void rewind (FILE *stream)
1227 /*@modifies *stream@*/ ;
1229 void setbuf (FILE *stream, /*@null@*/ /*@dependent@*/ /*@exposed@*/ char *buf)
1230 /*@modifies stream@*/
1232 int setvbuf (FILE *stream, /*@null@*/ /*@dependent@*/ /*@exposed@*/ char *buf, int type, size_t size)
1233 /*@modifies stream@*/
1234 /*:errorcode !0:*/ ;
1236 int snprintf (char *s, size_t n, const char *format, ...);
1238 int sprintf(char *, const char *, ...);
1239 int sscanf(const char *, const char *, int ...);
1240 char *tempnam(const char *, const char *);
1241 FILE *tmpfile(void);
1242 char *tmpnam(char *);
1243 int ungetc(int, FILE *);
1244 int vfprintf(FILE *, const char *, va_list);
1245 int vprintf(const char *, va_list);
1246 int vsnprintf(char *, size_t, const char *, va_list);
1247 int vsprintf(char *, const char *, va_list);
1250 The following external variables are defined:
1253 extern char *optarg; )
1254 extern int opterr; )
1255 extern int optind; ) (LEGACY)
1256 extern int optopt; )
1264 /*@constant int LOG_EMERG@*/
1265 /*@constant int LOG_ALERT@*/
1266 /*@constant int LOG_CRIT@*/
1267 /*@constant int LOG_ERR@*/
1268 /*@constant int LOG_WARNING@*/
1269 /*@constant int LOG_NOTICE@*/
1270 /*@constant int LOG_INFO@*/
1271 /*@constant int LOG_DEBUG@*/
1273 /*@constant int LOG_KERN@*/
1274 /*@constant int LOG_USER@*/
1275 /*@constant int LOG_MAIL@*/
1276 /*@constant int LOG_DAEMON@*/
1277 /*@constant int LOG_AUTH@*/
1278 /*@constant int LOG_SYSLOG@*/
1279 /*@constant int LOG_LPR@*/
1280 /*@constant int LOG_NEWS@*/
1281 /*@constant int LOG_UUCP@*/
1282 /*@constant int LOG_CRON@*/
1283 /*@constant int LOG_AUTHPRIV@*/
1284 /*@constant int LOG_FTP@*/
1285 /*@constant int LOG_LOCAL0@*/
1286 /*@constant int LOG_LOCAL1@*/
1287 /*@constant int LOG_LOCAL2@*/
1288 /*@constant int LOG_LOCAL3@*/
1289 /*@constant int LOG_LOCAL4@*/
1290 /*@constant int LOG_LOCAL5@*/
1291 /*@constant int LOG_LOCAL6@*/
1292 /*@constant int LOG_LOCAL7@*/
1294 /*@constant int LOG_PID@*/
1295 /*@constant int LOG_CONS@*/
1296 /*@constant int LOG_ODELAY@*/
1297 /*@constant int LOG_NDELAY@*/
1298 /*@constant int LOG_NOWAIT@*/
1299 /*@constant int LOG_PERROR@*/
1301 int LOG_MASK (int pri)
1304 int LOG_UPTO (int pri)
1307 void closelog (void)
1308 /*@modifies fileSystem@*/;
1310 void openlog (const char *ident, int logopt, int facility)
1311 /*@modifies fileSystem@*/;
1313 int setlogmask (int maskpri)
1314 /*@modifies internalState@*/;
1316 void /*@printflike@*/ syslog (int priority, const char *message, ...)
1317 /*@modifies fileSystem@*/;
1319 void vsyslog (int priority, const char *message, va_list args)
1320 /*@modifies fileSystem@*/;
1322 /*________________________________________________________________________
1328 /*@modifies internalState@*/;
1330 extern /*@null@*/ struct passwd *
1332 /*@modifies internalState@*/;
1335 setpassent (int stayopen)
1336 /*@modifies internalState@*/;
1340 /*@modifies internalState@*/;
1342 /*________________________________________________________________________
1348 /*@modifies internalState@*/;
1350 extern /*@null@*/ struct group *
1352 /*@modifies internalState@*/;
1356 /*@modifies internalState@*/;
1359 setgrfile (const char *name)
1360 /*@modifies internalState@*/;
1363 setgroupent (int stayopen)
1364 /*@modifies internalState@*/;
1369 ** evans 2001-08-26 - updated from http://www.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html
1373 ** struct stat replaces POSIX version - more required fields in Unix
1376 /*@-redef@*/ /*@-matchfields@*/
1378 dev_t st_dev; /* ID of device containing file */
1379 ino_t st_ino; /* file serial number */
1380 mode_t st_mode; /* mode of file (see below) */
1381 nlink_t st_nlink; /* number of links to the file */
1382 uid_t st_uid; /* user ID of file */
1383 gid_t st_gid; /* group ID of file */
1384 dev_t st_rdev; /* device ID (if file is character or block special) */
1385 off_t st_size; /* file size in bytes (if file is a regular file) */
1386 time_t st_atime; /* time of last access */
1387 time_t st_mtime; /* time of last data modification */
1388 time_t st_ctime; /* time of last status change */
1389 blksize_t st_blksize; /* a filesystem-specific preferred I/O block size for
1390 this object. In some filesystem types, this may
1391 vary from file to file */
1392 blkcnt_t st_blocks; /* number of blocks allocated for this object */
1394 /*@=redef@*/ /*@=matchfields@*/
1396 /*@constant mode_t S_IWUSR@*/
1397 /*@constant mode_t S_IXUSR@*/
1398 /*@constant mode_t S_IRWXG@*/
1399 /*@constant mode_t S_IRGRP@*/
1400 /*@constant mode_t S_IWGRP@*/
1401 /*@constant mode_t S_IXGRP@*/
1402 /*@constant mode_t S_IRWXO@*/
1403 /*@constant mode_t S_IROTH@*/
1404 /*@constant mode_t S_IWOTH@*/
1405 /*@constant mode_t S_IXOTH@*/
1406 /*@constant mode_t S_ISUID@*/
1407 /*@constant mode_t S_ISGID@*/
1408 /*@constant mode_t S_ISVTX@*/
1411 /*These are the old definitions - they don't appear to be in the Single UNIX Specification */
1413 /*@constant int S_ISTXT@*/
1414 /*@constant int S_IREAD@*/
1415 /*@constant int S_IWRITE@*/
1416 /*@constant int S_IEXEC@*/
1417 /*@constant int S_IFMT@*/
1418 /*@constant int S_IFIFO@*/
1419 /*@constant int S_IFCHR@*/
1420 /*@constant int S_IFDIR@*/
1421 /*@constant int S_IFBLK@*/
1422 /*@constant int S_IFREG@*/
1423 /*@constant int S_IFLNK@*/
1424 /*@constant int S_IFSOCK@*/
1425 /*@constant int S_ISVTX@*/
1426 /*@constant int S_ISVTX@*/
1427 /*@constant int SF_SETTABLE@*/
1428 /*@constant int SF_ARCHIVED@*/
1429 /*@constant int ACCESSPERMS@*/
1430 /*@constant int ALLPERMS@*/
1431 /*@constant int DEFFILEMODE@*/
1432 /*@constant int S_BLKSIZE@*/
1433 /*@constant int SF_IMMUTABLE@*/
1434 /*@constant int SF_APPEND@*/
1435 /*@constant int UF_NODUMP@*/
1436 /*@constant int UF_IMMUTABLE@*/
1437 /*@constant int UF_APPEND@*/
1440 int /*@alt lltX_bool@*/ S_ISBLK (/*@sef@*/ mode_t m) /*@*/;
1441 int /*@alt lltX_bool@*/ S_ISCHR (/*@sef@*/ mode_t m) /*@*/;
1442 int /*@alt lltX_bool@*/ S_ISDIR (/*@sef@*/ mode_t m) /*@*/;
1443 int /*@alt lltX_bool@*/ S_ISFIFO (/*@sef@*/ mode_t m) /*@*/;
1444 int /*@alt lltX_bool@*/ S_ISREG (/*@sef@*/ mode_t m) /*@*/;
1445 int /*@alt lltX_bool@*/ S_ISLNK (/*@sef@*/ mode_t m) /*@*/;
1447 int /*@alt lltX_bool@*/ S_TYPEISMQ (/*@sef@*/ struct stat *buf) /*@*/ ;
1448 int /*@alt lltX_bool@*/ S_TYPEISSEM (/*@sef@*/ struct stat *buf) /*@*/ ;
1449 int /*@alt lltX_bool@*/ S_TYPEISSHM (/*@sef@*/ struct stat *buf) /*@*/ ;
1451 /* in POSIX: chmod, fstat, mkdir, mkfifo, stat, umask */
1453 int lstat(const char *, /*@out@*/ struct stat *)
1455 /*@modifies errno@*/ ;
1457 int mknod (const char *, mode_t, dev_t)
1458 /*@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."@*/
1460 /*@modifies errno@*/ ;
1462 int chflags (const char *path, u_long flags)
1463 /*@warn unixstandard "Not in Single UNIX Specification Version 2"@*/
1464 /*@modifies fileSystem, errno@*/;
1466 int fchflags (int fd, u_long flags)
1467 /*@warn unixstandard "Not in Single UNIX Specification Version 2"@*/
1468 /*@modifies fileSystem, errno@*/;
1470 /* evans 2002-03-17: this was missing, reported by Ralf Wildenhues */
1471 int fchmod(int fildes, mode_t mode)
1472 /*@modifies fileSystem, errno@*/ ;
1476 ** from http://www.opengroup.org/onlinepubs/007908799/xsh/sysstatvfs.h.html
1480 unsigned long f_bsize;
1481 unsigned long f_frsize;
1482 fsblkcnt_t f_blocks;
1484 fsblkcnt_t f_bavail;
1487 fsfilcnt_t f_favail;
1488 unsigned long f_fsid;
1489 unsigned long f_flag;
1490 unsigned long f_namemax;
1493 /*@constant unsigned long ST_RDONLY; @*/
1494 /*@constant unsigned long ST_NOSUID; @*/
1496 int fstatvfs (int fildes, /*@out@*/ struct statvfs *buf)
1497 /*@modifies buf@*/ ;
1499 int statvfs (const char *path, /*@out@*/ struct statvfs *buf)
1500 /*@modifies buf@*/ ;
1503 /*________________________________________________________________________
1507 /*@constant int FMNAMESZ@*/
1508 /*@constant int MSG_BAND@*/
1509 /*@constant int MSG_HIPRI@*/
1510 /*@constant int RS_HIPRI@*/
1511 /*@constant int S_INPUT@*/
1512 /*@constant int S_RDNORM@*/
1513 /*@constant int S_RDBAND@*/
1514 /*@constant int S_BANDURG@*/
1515 /*@constant int S_HIPRI@*/
1516 /*@constant int S_OUTPUT@*/
1517 /*@constant int S_WRNORM@*/
1518 /*@constant int S_WRBAND@*/
1519 /*@constant int S_MSG@*/
1520 /*@constant int S_ERROR@*/
1521 /*@constant int S_HANGUP@*/
1535 struct str_mlist *sl_modlist;
1539 getmsg (int fd, /*@out@*/ struct strbuf *c, /*@out@*/ struct strbuf *d, int *f)
1540 /*@modifies *c, *d, errno@*/;
1543 getpmsg (int fd, /*@out@*/ struct strbuf *c, /*@out@*/ struct strbuf *d, int *b, int *f)
1544 /*@modifies *b, *c, *d, errno@*/;
1547 putmsg (int fd, const struct strbuf *c, const struct strbuf *d, int *f)
1548 /*@modifies internalState, errno@*/;
1550 extern int putpmsg (int fd, const struct strbuf *c, const struct strbuf *d, int b, int *f)
1551 /*@modifies internalState, errno@*/;
1553 /*________________________________________________________________________
1557 /*@constant int RLIMIT_CPU@*/
1558 /*@constant int RLIMIT_FSIZE@*/
1559 /*@constant int RLIMIT_DATA@*/
1560 /*@constant int RLIMIT_STACK@*/
1561 /*@constant int RLIMIT_CORE@*/
1562 /*@constant int RLIMIT_RSS@*/
1563 /*@constant int RLIMIT_MEMLOCK@*/
1564 /*@constant int RLIMIT_NPROC@*/
1565 /*@constant int RLIMIT_NOFILE@*/
1566 /*@constant int RLIM_NLIMITS@*/
1567 /*@constant int RLIM_INFINITY@*/
1568 /*@constant int PRIO_MIN@*/
1569 /*@constant int PRIO_MAX@*/
1570 /*@constant int PRIO_PROCESS@*/
1571 /*@constant int PRIO_PGRP@*/
1572 /*@constant int PRIO_USER@*/
1573 /*@constant int RUSAGE_SELF@*/
1574 /*@constant int RUSAGE_CHILDREN@*/
1577 struct timeval ru_utime; /* user time used */
1578 struct timeval ru_stime; /* system time used */
1579 long ru_maxrss; /* max resident set size */
1580 long ru_ixrss; /* integral shared memory size */
1581 long ru_idrss; /* integral unshared data " */
1582 long ru_isrss; /* integral unshared stack " */
1583 long ru_minflt; /* page reclaims */
1584 long ru_majflt; /* page faults */
1585 long ru_nswap; /* swaps */
1586 long ru_inblock; /* block input operations */
1587 long ru_oublock; /* block output operations */
1588 long ru_msgsnd; /* messages sent */
1589 long ru_msgrcv; /* messages received */
1590 long ru_nsignals; /* signals received */
1591 long ru_nvcsw; /* voluntary context switches */
1592 long ru_nivcsw; /* involuntary " */
1601 unsigned long ldavg[3];
1606 getpriority (int which, int who)
1607 /*@modifies errno@*/;
1610 getrlimit (int res, /*@out@*/ struct rlimit *rlp)
1611 /*@modifies *rlp, errno@*/;
1614 getrusage (int who, /*@out@*/ struct rusage *rusage)
1615 /*@modifies *rusage, errno@*/;
1618 setpriority (int which, int who, int prio)
1619 /*@modifies errno, internalState@*/;
1622 setrlimit (int resource, const struct rlimit *rlp)
1623 /*@modifies errno, internalState@*/;
1632 /*@observer@*/ char *s_name; /* Official service name. */
1633 /*@observer@*/ char **s_aliases; /* Alias list. */
1634 int s_port; /* Port number. */
1635 /*@observer@*/ char *s_proto; /* Protocol to use. */
1638 /*@observer@*/ /*@dependent@*/ /*@null@*/ struct servent *getservbyname (const char *name, /*@null@*/ const char *proto)
1639 /*@warn multithreaded "Unsafe in multithreaded applications, use getsrvbyname_r instead"@*/ ;
1641 struct servent *getservbyname_r (const char *name, /*@null@*/ const char *proto, /*@out@*/ /*@returned@*/ struct servent *result, /*@out@*/ char *buffer, int buflen)
1642 /*@requires maxSet (buffer) >= buflen@*/ ;
1645 /*@observer@*/ /*@dependent@*/ struct servent *getservbyport (int port, /*@null@*/ const char *proto)
1646 /*@warn multithreaded "Unsafe in multithreaded applications, use getservbyport_r instead"@*/ ;
1648 struct servent *getservbyport_r (int port, /*@null@*/ const char *proto, /*@out@*/ /*@returned@*/ struct servent *result, /*@out@*/ char *buffer, int buflen)
1649 /*@requires maxSet (buffer) >= buflen@*/ ;
1651 /*@null@*/ struct servent *getservent (void);
1653 /*@null@*/ struct servent *getservent_r (struct servent *result, char *buffer, int buflen);
1655 int setservent (int stayopen);
1656 int endservent (void);
1660 /*@null@*/ /*@observer@*/ struct hostent *gethostbyname (/*@nullterminated@*/ /*@notnull@*/ const char *name)
1661 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostbyname_r instead"@*/
1662 /*@modifies h_errno@*/ ;
1664 struct hostent *gethostbyname_r (/*@nullterminated@*/ const char *name, /*@notnull@*/ /*@returned@*/ struct hostent *hent, /*@out@*/ /*@exposed@*/ char *buffer, int bufsize, /*@out@*/ int *h_errnop)
1665 /*@requires maxSet(buffer) >= bufsize@*/ ;
1667 /*@null@*/ /*@observer@*/ struct hostent *gethostbyaddr (/*@notnull@*/ const void *addr, size_t addrlen, int type)
1668 /*@requires maxRead(addr) == addrlen@*/ /*:i534 ??? is this right? */
1669 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostbyaddr_r instead"@*/
1670 /*@modifies h_errno@*/ ;
1672 struct hostent *gethostbyaddr_r (/*@notnull@*/ const void *addr, size_t addrlen, int type,
1673 /*@returned@*/ /*@out@*/ struct hostent *hent,
1674 /*@exposed@*/ /*@out@*/ char *buffer, int bufsize, /*@out@*/ int *h_errnop)
1675 /*@requires maxRead(addr) == addrlen /\ maxSet(buffer) >= bufsize@*/
1676 /*:i534 ??? is this right? */ ;
1678 /*@observer@*/ /*@null@*/ struct hostent *gethostent (void)
1679 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostent_r instead"@*/ ;
1681 struct hostent *gethostent_r (/*@out@*/ /*@returned@*/ struct hostent *hent, /*@exposed@*/ /*@out@*/ char *buffer, int bufsize)
1682 /*@requires maxSet(buffer) >= bufsize@*/ ;
1684 /*:i534 need to annotate these: */
1686 struct hostent *fgethostent(FILE *f);
1687 struct hostent *fgethostent_r(FILE*f, struct hostent *hent, char buffer, int bufsize);
1688 void sethostent(int stayopen);
1689 void endhostent(void);
1690 void herror(const char *string);
1691 char *hstrerror(int err);
1694 /*@observer@*/ /*@nullterminated@*/ char *h_name; /* official name of host */
1695 /*@observer@*/ /*@nullterminated@*/ char * /*:observer@*/ /*:nullterminated@*/ *h_aliases; /* alias list */
1696 int h_addrtype; /* host address type*/
1697 int h_length; /* length ofaddress*/
1698 /*@observer@*/ /*@nullterminated@*/ char * /*:observer@*/ /*:nullterminated@*/ *h_addr_list; /* list of addressesfrom name server */
1699 /*@observer@*/ /*@nullterminated@*/ char *h_addr; /* first address in list (backward compatibility) */
1704 ** from http://www.opengroup.org/onlinepubs/007908799/xsh/unistd.h.html
1707 /*@constant int _POSIX_VERSION@*/
1708 /*@constant int _POSIX2_VERSION@*/
1709 /*@constant int _POSIX2_C_VERSION@*/
1710 /*@constant int _XOPEN_VERSION@*/
1711 /*@constant int _XOPEN_XCU_VERSION@*/
1715 /*@constant int R_OK@*/
1716 /*@constant int W_OK@*/
1717 /*@constant int X_OK@*/
1718 /*@constant int F_OK@*/
1721 /*@constant int _CS_PATH@*/
1722 /*@constant int _CS_XBS5_ILP32_OFF32_CFLAGS@*/
1723 /*@constant int _CS_XBS5_ILP32_OFF32_LDFLAGS@*/
1724 /*@constant int _CS_XBS5_ILP32_OFF32_LIBS@*/
1725 /*@constant int _CS_XBS5_ILP32_OFF32_LINTFLAGS@*/
1726 /*@constant int _CS_XBS5_ILP32_OFFBIG_CFLAGS@*/
1727 /*@constant int _CS_XBS5_ILP32_OFFBIG_LDFLAGS@*/
1728 /*@constant int _CS_XBS5_ILP32_OFFBIG_LIBS@*/
1729 /*@constant int _CS_XBS5_ILP32_OFFBIG_LINTFLAGS@*/
1730 /*@constant int _CS_XBS5_LP64_OFF64_CFLAGS@*/
1731 /*@constant int _CS_XBS5_LP64_OFF64_LDFLAGS@*/
1732 /*@constant int _CS_XBS5_LP64_OFF64_LIBS@*/
1733 /*@constant int _CS_XBS5_LP64_OFF64_LINTFLAGS@*/
1734 /*@constant int _CS_XBS5_LPBIG_OFFBIG_CFLAGS@*/
1735 /*@constant int _CS_XBS5_LPBIG_OFFBIG_LDFLAGS@*/
1736 /*@constant int _CS_XBS5_LPBIG_OFFBIG_LIBS@*/
1737 /*@constant int _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS@*/
1739 /* name parameters to sysconf: */
1741 /*@constant int _SC_2_C_BIND@*/
1742 /*@constant int _SC_2_C_DEV@*/
1743 /*@constant int _SC_2_C_VERSION@*/
1744 /*@constant int _SC_2_FORT_DEV@*/
1745 /*@constant int _SC_2_FORT_RUN@*/
1746 /*@constant int _SC_2_LOCALEDEF@*/
1747 /*@constant int _SC_2_SW_DEV@*/
1748 /*@constant int _SC_2_UPE@*/
1749 /*@constant int _SC_2_VERSION@*/
1750 /*@constant int _SC_ARG_MAX@*/
1751 /*@constant int _SC_AIO_LISTIO_MAX@*/
1752 /*@constant int _SC_AIO_MAX@*/
1753 /*@constant int _SC_AIO_PRIO_DELTA_MAX@*/
1754 /*@constant int _SC_ASYNCHRONOUS_IO@*/
1755 /*@constant int _SC_ATEXIT_MAX@*/
1756 /*@constant int _SC_BC_BASE_MAX@*/
1757 /*@constant int _SC_BC_DIM_MAX@*/
1758 /*@constant int _SC_BC_SCALE_MAX@*/
1759 /*@constant int _SC_BC_STRING_MAX@*/
1760 /*@constant int _SC_CHILD_MAX@*/
1761 /*@constant int _SC_CLK_TCK@*/
1762 /*@constant int _SC_COLL_WEIGHTS_MAX@*/
1763 /*@constant int _SC_DELAYTIMER_MAX@*/
1764 /*@constant int _SC_EXPR_NEST_MAX@*/
1765 /*@constant int _SC_FSYNC@*/
1766 /*@constant int _SC_GETGR_R_SIZE_MAX@*/
1767 /*@constant int _SC_GETPW_R_SIZE_MAX@*/
1768 /*@constant int _SC_IOV_MAX@*/
1769 /*@constant int _SC_JOB_CONTROL@*/
1770 /*@constant int _SC_LINE_MAX@*/
1771 /*@constant int _SC_LOGIN_NAME_MAX@*/
1772 /*@constant int _SC_MAPPED_FILES@*/
1773 /*@constant int _SC_MEMLOCK@*/
1774 /*@constant int _SC_MEMLOCK_RANGE@*/
1775 /*@constant int _SC_MEMORY_PROTECTION@*/
1776 /*@constant int _SC_MESSAGE_PASSING@*/
1777 /*@constant int _SC_MQ_OPEN_MAX@*/
1778 /*@constant int _SC_MQ_PRIO_MAX@*/
1779 /*@constant int _SC_NGROUPS_MAX@*/
1780 /*@constant int _SC_OPEN_MAX@*/
1781 /*@constant int _SC_PAGESIZE@*/
1782 /*@constant int _SC_PAGE_SIZE@*/
1783 /*@constant int _SC_PASS_MAX@*/
1784 /*@constant int _SC_PRIORITIZED_IO@*/
1785 /*@constant int _SC_PRIORITY_SCHEDULING@*/
1786 /*@constant int _SC_RE_DUP_MAX@*/
1787 /*@constant int _SC_REALTIME_SIGNALS@*/
1788 /*@constant int _SC_RTSIG_MAX@*/
1789 /*@constant int _SC_SAVED_IDS@*/
1790 /*@constant int _SC_SEMAPHORES@*/
1791 /*@constant int _SC_SEM_NSEMS_MAX@*/
1792 /*@constant int _SC_SEM_VALUE_MAX@*/
1793 /*@constant int _SC_SHARED_MEMORY_OBJECTS@*/
1794 /*@constant int _SC_SIGQUEUE_MAX@*/
1795 /*@constant int _SC_STREAM_MAX@*/
1796 /*@constant int _SC_SYNCHRONIZED_IO@*/
1797 /*@constant int _SC_THREADS@*/
1798 /*@constant int _SC_THREAD_ATTR_STACKADDR@*/
1799 /*@constant int _SC_THREAD_ATTR_STACKSIZE@*/
1800 /*@constant int _SC_THREAD_DESTRUCTOR_ITERATIONS@*/
1801 /*@constant int _SC_THREAD_KEYS_MAX@*/
1802 /*@constant int _SC_THREAD_PRIORITY_SCHEDULING@*/
1803 /*@constant int _SC_THREAD_PRIO_INHERIT@*/
1804 /*@constant int _SC_THREAD_PRIO_PROTECT@*/
1805 /*@constant int _SC_THREAD_PROCESS_SHARED@*/
1806 /*@constant int _SC_THREAD_SAFE_FUNCTIONS@*/
1807 /*@constant int _SC_THREAD_STACK_MIN@*/
1808 /*@constant int _SC_THREAD_THREADS_MAX@*/
1809 /*@constant int _SC_TIMERS@*/
1810 /*@constant int _SC_TIMER_MAX@*/
1811 /*@constant int _SC_TTY_NAME_MAX@*/
1812 /*@constant int _SC_TZNAME_MAX@*/
1813 /*@constant int _SC_VERSION@*/
1814 /*@constant int _SC_XOPEN_VERSION@*/
1815 /*@constant int _SC_XOPEN_CRYPT@*/
1816 /*@constant int _SC_XOPEN_ENH_I18N@*/
1817 /*@constant int _SC_XOPEN_SHM@*/
1818 /*@constant int _SC_XOPEN_UNIX@*/
1819 /*@constant int _SC_XOPEN_XCU_VERSION@*/
1820 /*@constant int _SC_XOPEN_LEGACY@*/
1821 /*@constant int _SC_XOPEN_REALTIME@*/
1822 /*@constant int _SC_XOPEN_REALTIME_THREADS@*/
1823 /*@constant int _SC_XBS5_ILP32_OFF32@*/
1824 /*@constant int _SC_XBS5_ILP32_OFFBIG@*/
1825 /*@constant int _SC_XBS5_LP64_OFF64@*/
1826 /*@constant int _SC_XBS5_LPBIG_OFFBIG@*/
1829 int access(const char *, int) /*@modifies errno@*/ /*:errorcode -1:*/ ;
1830 unsigned int alarm (unsigned int) /*@modifies internalState@*/ ;
1833 /*@modifies errno@*/
1835 /*@warn legacy "brk is obsolete"@*/ ;
1837 int chdir (const char *)
1838 /*@modifies internalState, errno@*/
1839 /*:errorcode -1:*/ ;
1841 int chown (const char *, uid_t, gid_t)
1842 /*@modifies internalState, errno@*/
1843 /*:errorcode -1:*/ ;
1846 /*@modifies internalState, errno@*/
1847 /*:errorcode -1:*/ ;
1849 size_t confstr(int, /*@null@*/ char *, size_t)
1850 /*@globals internalState@*/
1851 /*@modifies errno@*/
1854 /*@dependent@*/ /*@null@*/ char *crypt(const char *, const char *)
1855 /*@modifies errno, internalState@*/ ;
1857 /*@dependent@*/ /*@null@*/ char *ctermid(/*@returned@*/ /*@null@*/ /*@out@*/ char *s)
1860 /*@null@*/ /*@dependent@*/ char *cuserid (/*@null@*/ /*@returned@*/ char *s)
1861 /*@warn legacy "cuserid is obsolete"@*/
1865 /*@modifies errno, internalState@*/
1866 /*:errorcode -1:*/ ;
1869 /*@modifies errno, internalState@*/
1870 /*:errorcode -1:*/ ;
1872 void encrypt(char p_block[], int)
1873 /*@requires maxSet(p_block) == 63@*/
1874 /*@modifies p_block, errno@*/ ;
1876 extern char **environ;
1878 int execl (const char *, const char *, ...)
1879 /*@modifies errno, internalState@*/
1880 /*:errorcode -1:*/ ;
1882 int execle(const char *, const char *, ...)
1883 /*@modifies errno, internalState@*/
1884 /*:errorcode -1:*/ ;
1886 int execlp(const char *, const char *, ...)
1887 /*@modifies errno, internalState@*/
1888 /*:errorcode -1:*/ ;
1890 int execv(const char *, char *const [])
1891 /*@modifies errno, internalState@*/
1892 /*:errorcode -1:*/ ;
1894 int execve(const char *, char *const [], char *const [])
1895 /*@modifies errno, internalState@*/
1896 /*:errorcode -1:*/ ;
1898 int execvp(const char *, char *const [])
1899 /*@modifies errno, internalState@*/
1900 /*:errorcode -1:*/ ;
1902 /*@exits@*/ void _exit (int);
1904 int fchown (int, uid_t, gid_t)
1905 /*@modifies errno, fileSystem@*/
1906 /*:errorcode -1:*/ ;
1909 /*@modifies errno, fileSystem@*/
1910 /*:errorcode -1:*/ ;
1913 /*@modifies errno, fileSystem@*/
1914 /*:errorcode -1:*/ ;
1917 /*@modifies errno, internalState@*/
1918 /*:errorcode -1:*/ ;
1920 long int fpathconf(int, int)
1921 /*@modifies errno, internalState@*/
1922 /*:errorcode -1:*/ ;
1925 /*@modifies errno, fileSystem@*/
1926 /*:errorcode -1:*/ ;
1928 int ftruncate(int, off_t)
1929 /*@modifies errno, fileSystem@*/
1930 /*:errorcode -1:*/ ;
1932 /*@null@*/ char *getcwd (/*@returned@*/ char *buf, size_t size)
1933 /*@requires maxSet(buf) >= size;@*/
1934 /*@modifies errno@*/ ;
1936 int getdtablesize (void)
1937 /*@warn legacy "getdtablesize is obsolete"@*/ ;
1939 gid_t getegid (void) /*@globals internalState*/ ;
1940 uid_t geteuid (void) /*@globals internalState*/ ;
1941 gid_t getgid (void) /*@globals internalState*/ ;
1943 int getgroups (int gidsetsize, gid_t grouplist[])
1944 /*@requires maxSet(grouplist) >= gidsetsize@*/
1945 /*@modifies errno@*/
1946 /*:errorcode -1:*/ ;
1948 long gethostid (void) /*@globals internalState@*/ ;
1950 /*@null@*/ /*@dependent@*/ char *getlogin (void)
1951 /*@modifies errno@*/ ;
1953 int getlogin_r (char *name, size_t namesize)
1954 /*@requires maxSet(name) >= namesize@*/
1955 /*:errorcode !0:*/ ;
1957 extern char *optarg;
1962 int getopt(int, char * const [], const char *)
1963 /*@modifies optind, opterr, optopt, errno@*/
1964 /*:errorcode -1:*/ ;
1966 int getpagesize(void)
1967 /*@warn legacy "getpagesize is obsolete"@*/ ;
1969 /*@dependent@*/ /*@null@*/ char *getpass(/*@nullterminated@*/ const char *)
1970 /*@warn legacy "getpass is obsolete"@*/ ;
1972 pid_t getpgid(pid_t)
1973 /*@modifies errno@*/
1974 /*@globals internalState@*/
1975 /*:errorcode (pid_t)-1:*/ ;
1977 pid_t getpgrp(void) /*@globals internalState*/ ;
1979 pid_t getpid(void) /*@globals internalState*/ ;
1980 pid_t getppid(void) /*@globals internalState*/ ;
1983 /*@modifies errno@*/
1984 /*@globals internalState@*/
1985 /*:errorcode (pid_t)-1:*/ ;
1987 uid_t getuid(void) /*@globals internalState@*/ ;
1989 /*@null@*/ char *getwd (/*@returned@*/ char *path_name)
1990 /*@modifies path_name@*/ ;
1993 /*@globals internalState@*/
1994 /*@modifies errno@*/
1997 int lchown(const char *, uid_t, gid_t)
1998 /*@modifies errno, fileSystem@*/
1999 /*:errorcode -1:*/ ;
2001 int link(const char *, const char *)
2002 /*@modifies errno, fileSystem@*/
2003 /*:errorcode -1:*/ ;
2005 int lockf(int, int, off_t)
2006 /*@modifies errno, fileSystem@*/
2007 /*:errorcode -1:*/ ;
2009 off_t lseek(int, off_t, int)
2010 /*@modifies errno, fileSystem@*/
2011 /*:errorcode (off_t)-1:*/ ;
2014 /*@modifies errno, fileSystem@*/
2015 /*:errorcode -1:*/ ;
2017 long int pathconf(const char *, int)
2018 /*@modifies errno, internalState@*/
2019 /*:errorcode -1:*/ ;
2022 /*@modifies errno, internalState@*/
2023 /*:errorcode -1:*/ ;
2026 /*@requires maxRead(p) == 1@*/
2027 /*@modifies errno, fileSystem@*/
2028 /*:errorcode -1:*/ ;
2030 ssize_t pread(int, /*@out@*/ void *buf, size_t nbyte, off_t offset)
2031 /*@modifies errno, fileSystem@*/
2032 /*@requires maxSet(buf) >= (nbyte - 1) @*/
2033 /*@ensures maxRead(buf) >= nbyte @*/
2034 /*:errorcode -1:*/ ;
2036 int pthread_atfork(void (*)(void), void (*)(void), void(*)(void))
2037 /*@modifies errno, fileSystem@*/
2038 /*:errorcode !0:*/ ;
2040 ssize_t pwrite(int, const void *buf, size_t nbyte, off_t)
2041 /*@requires maxRead(buf) >= nbyte@*/
2042 /*@modifies errno, fileSystem@*/
2043 /*:errorcode -1:*/ ;
2045 /* ssize_t read(int, void *, size_t); in posix.h */
2047 int readlink(const char *, char *buf, size_t bufsize)
2048 /*@requires maxSet(buf) >= (bufsize - 1)@*/
2049 /*@modifies errno, fileSystem, *buf@*/
2050 /*:errorcode -1:*/ ;
2052 /* int rmdir(const char *); in posix.h */
2054 void *sbrk(intptr_t)
2055 /*@modifies errno@*/
2056 /*:errorcode (void *)-1:*/
2057 /*@warn legacy "sbrk is obsolete"@*/ ;
2059 /* int setgid(gid_t);
2060 int setpgid(pid_t, pid_t);
2063 pid_t setpgrp(void) /*@modifies internalState@*/ ;
2065 int setregid(gid_t, gid_t)
2066 /*@modifies errno, internalState@*/
2067 /*:errorcode -1:*/ ;
2069 int setreuid(uid_t, uid_t)
2070 /*@modifies errno, internalState@*/
2071 /*:errorcode -1:*/ ;
2074 /*@modifies errno, internalState@*/
2075 /*:errorcode (pid_t) -1:*/ ;
2078 /*@modifies errno, internalState@*/
2079 /*:errorcode -1:*/ ;
2081 unsigned int sleep(unsigned int)
2082 /*@modifies systemState@*/ ;
2084 void swab(/*@unique@*/ const void *src, /*@unique@*/ void *dest, ssize_t nbytes)
2085 /*@requires maxSet(dest) >= (nbytes - 1)@*/ ;
2087 int symlink(const char *, const char *)
2088 /*@modifies errno, fileSystem@*/
2089 /*:errorcode -1:*/ ;
2091 void sync(void) /*@modifies systemState@*/ ;
2093 long int sysconf(int)
2094 /*@modifies errno, systemState@*/
2095 /*:errorcode -1:*/ ;
2097 pid_t tcgetpgrp(int)
2098 /*@globals systemState@*/
2099 /*@modifies errno@*/
2100 /*:errorcode -1:*/ ;
2102 int tcsetpgrp(int, pid_t)
2103 /*@modifies errno, systemState@*/
2104 /*:errorcode -1:*/ ;
2106 int truncate(const char *, off_t)
2107 /*@modifies errno, fileSystem@*/
2108 /*:errorcode -1:*/ ;
2110 /*@dependent@*/ /*@null@*/ char *ttyname(int)
2111 /*@globals systemState@*/
2112 /*@modifies errno@*/
2113 /*:errorcode -1:*/ ;
2115 int ttyname_r(int, char *name, size_t namesize)
2116 /*@requires maxSet(name) >= (namesize - 1)@*/ ;
2117 /*:errorcode !0:*/ ;
2119 useconds_t ualarm(useconds_t, useconds_t)
2120 /*@modifies systemState@*/ ;
2122 int unlink(const char *)
2123 /*@modifies fileSystem, errno@*/
2124 /*:errorcode -1:*/ ;
2126 int usleep(useconds_t)
2127 /*@modifies fileSystem, errno@*/
2128 /*:errorcode -1:*/ ;
2131 /*@modifies fileSystem, errno@*/
2132 /*:errorcode -1:*/ ;
2134 /* in posix.h ssize_t write(int, const void *, size_t); */
2137 int chroot (/*@notnull@*/ /*@nullterminated@*/ const char *path)
2138 /*@modifies internalState, errno@*/
2140 /*@warn superuser "Only super-user processes may call chroot."@*/ ;
2142 int fchroot (int fildes)
2144 /*@warn superuser "Only super-user processes may call fchroot."@*/ ;
2150 ** evans 2001-08-26 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/ctype.h.html
2154 lltX_bool isascii(int) /*@*/ ;
2155 lltX_bool toascii(int) /*@*/ ;
2156 char _toupper(/*@sef@*/ int) /*@*/ ;
2157 char _tolower(/*@sef@*/ int) /*@*/ ;
2159 lltX_bool /*@alt int@*/ isascii(int /*@alt unsigned char@*/) /*@*/ ;
2160 lltX_bool /*@alt int@*/ toascii(int /*@alt unsigned char@*/);
2161 char /*@alt int@*/ _toupper(/*@sef@*/ int /*@alt unsigned char@*/);
2162 char /*@alt int@*/ _tolower(/*@sef@*/ int /*@alt unsigned char@*/);
2165 /* other ctype.h functions in ansi.h */
2170 ** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/drand48.html
2173 double drand48 (void) /*@modifies internalState@*/ ;
2174 double erand48 (unsigned short int /*@-fixedformalarray@*/ xsubi[3] /*@=fixedformalarray@*/ )
2175 /*@modifies internalState@*/ ;
2177 void srand48 (long int seedval) /*@modifies internalState@*/ ;
2182 ** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xns/netinetin.h.html
2185 typedef /*@unsignedintegraltype@*/ in_port_t; /* An unsigned integral type of exactly 16 bits. */
2186 typedef /*@unsignedintegraltype@*/ in_addr_t; /* An unsigned integral type of exactly 32 bits. */
2188 typedef /*@unsignedintegraltype@*/ sa_family_t;
2194 struct sockaddr_in {
2195 sa_family_t sin_family;
2197 struct in_addr sin_addr;
2198 unsigned char sin_zero[8];
2202 /* The <netinet/in.h> header defines the following macros for use as values of the level argument of
2203 getsockopt() and setsockopt():
2206 /*@constant int IPPROTO_IP@*/
2207 /*@constant int IPPROTO_ICMP@*/
2208 /*@constant int IPPROTO_TCP@*/
2209 /*@constant int IPPROTO_UDP@*/
2211 /* The <netinet/in.h> header defines the following macros for use as destination addresses for connect(), sendmsg() and sendto():
2214 /*@constant in_addr_t INADDR_ANY@*/
2215 /*@constant in_addr_t INADDR_BROADCAST@*/
2221 in_addr_t htonl (in_addr_t hostlong) /*@*/ ;
2222 in_port_t htons (in_port_t hostshort) /*@*/ ;
2223 in_addr_t ntohl (in_addr_t netlong) /*@*/ ;
2224 in_port_t ntohs (in_port_t netshort) /*@*/ ;
2229 ** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/dirent.h.html
2232 /*@-redef@*/ /*@-matchfields@*/ /* Has d_ino field, not in posix (?) */
2240 /*@=redef@*/ /*@=matchfields@*/
2242 typedef /*@abstract@*/ DIR;
2244 /*:i32 need to check annotations on these */
2246 int closedir (DIR *) /*:errorcode -1*/ ;
2247 /*@null@*/ /*@dependent@*/ DIR *opendir(const char *) /*@modifies errno, fileSystem@*/ ;
2249 /* in posix.h: struct dirent *readdir(DIR *); */
2251 int readdir_r (DIR *, struct dirent *, /*@out@*/ struct dirent **result)
2252 /*@modifies *result@*/
2253 /*:errorcode !0:*/ ;
2255 void rewinddir(DIR *);
2256 void seekdir(DIR *, long int);
2257 long int telldir(DIR *);
2259 /*drl added these functions
2260 stpcpy and stpncpy are found on linux but
2261 don't seem to be present on other unixes
2263 thanks to Jeff Johnson for pointing out that
2264 these functions were in the unix library
2267 /* this function is like strcpy but it reutrns a pointer to the null terminated character in dest instead of the beginning of dest */
2269 extern char * stpcpy(/*@out@*/ /*@returned@*/ char * dest, const char * src)
2270 /*@modifies *dest @*/
2271 /*@requires maxSet(dest) >= maxRead(src) @*/
2272 /*@ensures MaxRead(dest) == MaxRead (src) /\ MaxRead(result) == 0 /\ MaxSet(result) == ( maxSet(dest) - MaxRead(src) ); @*/;
2275 extern char * stpncpy(/*@out@*/ /*@returned@*/ char * dest,
2276 const char * src, size_t n)
2277 /*@modifies *dest @*/
2278 /*@requires MaxSet(dest) >= ( n - 1 ); @*/ /*@ensures MaxRead (src) >= MaxRead(dest) /\ MaxRead (dest) <= n; @*/
2281 /* drl added 09-25-001
2282 Alexander Ma pointed out these were missing
2285 int usleep (useconds_t useconds) /*@modifies systemState, errno@*/
2286 /*error -1 sucess 0 */
2287 /* warn opengroup unix specification recommends using setitimer(), timer_create(), timer_delete(), timer_getoverrun(), timer_gettime() or
2288 timer_settime() instead of this interface.
2293 /* drl added 10-27-001 */
2294 /*not sure what the exact size of this is
2295 also can IPv6 use this function?
2297 /*I'm going to assume that the address had the format:
2298 "###.###.###.###" which is 16 bytes*/
2300 /*@kept@*/ char *inet_ntoa(struct in_addr in)
2301 /*@ensures maxSet(result) <= 15 /\ maxRead(result) <= 15 @*/
2305 extern double hypot(double x, double y) /*@modifies errno@*/ /*error errno only*/;
2308 extern double j0(double x) /*@modifies errno @*/ /*error 0 or NaN */;
2309 extern double j1(double x) /*@modifies errno @*/ /*error 0 or NaN */;
2310 extern double jn(int n, double x) /*@modifies errno @*/ /*error 0 or NaN */;
2312 extern double y0(double x) /*@modifies errno @*/ /*error NaN -HUGE_VAL 0.0 */ ;
2313 extern double y1 (double x) /*@modifies errno @*/ /*error NaN -HUGE_VAL 0.0 */;
2314 extern double yn (int n, double x) /*@modifies errno @*/ /*error NaN -HUGE_VAL 0.0 */;
2316 extern double acosh(double x) /*@modifies errno @*/ /*error errno and implementation-dependent(NaN if present) */ /*error NaN and may errno*/;
2317 extern double asinh(double x) /*@modifies errno @*/ /*error NaN and may errno */;
2319 extern double atanh(double x) /*@modifies errno @*/ /*error errno and implementation-dependent(NaN if present) */ /*error NaN and may errno */ ;
2321 extern double lgamma(double x) /*@modifies errno @*/ /*error NaN or HUGE_VAL may set errno */;
2323 extern int signgam ;
2325 extern double erf(double x) /*@modifies errno @*/ /*error NaN or 0 may set errno */;
2327 extern double erfc (double x) /*@modifies errno @*/ /*error NaN or 0