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;
50 /*-------------------------------------------------------------
51 -------------------------------------------------------------
56 ** Extra stuff in some unixen, not in posix.
59 extern /*@unchecked@*/ int signgam;
61 /*@-redef@*/ /* Defined by ansi: */
62 typedef /*@integraltype@*/ clockid_t;
65 extern void bcopy (char *b1, /*@out@*/ char *b2, int length)
66 /*@modifies *b2@*/ ; /* Yes, the second parameter is the out param! */
68 extern int /*@alt lltX_bool@*/ bcmp (char *b1, char *b2, int length) /*@*/ ;
69 /* Return value is NOT like strcmp! */
71 extern void bzero (/*@out@*/ char *b1, int length) /*@modifies *b1@*/ ;
72 extern int ffs (int i) /*@*/ ;
73 extern int symlink (char *name1, char *name2) /*@modifies fileSystem@*/ ;
76 setvbuf_unlocked (FILE *stream, /*@null@*/ /*@exposed@*/ char *buf,
77 int mode, size_t size)
78 /*@modifies internalState@*/ ;
81 setbuffer (FILE *stream, /*@null@*/ /*@exposed@*/ char *buf, int size)
82 /*@modifies internalState@*/ ;
84 extern void setlinebuf (FILE *stream) /*@modifies internalState@*/ ;
86 extern int strerror_r (int errnum, /*@out@*/ char *strerrbuf, int buflen)
87 /*@modifies strerrbuf@*/ ;
90 fread_unlocked (/*@out@*/ void *ptr, size_t size, size_t nitems,
92 /*@modifies *stream, *ptr;@*/ ;
95 fwrite_unlocked (void *pointer, size_t size, size_t num_items, FILE *stream)
96 /*@modifies *stream;@*/ ;
98 extern void /*@alt void * @*/
99 memccpy (/*@returned@*/ /*@out@*/ void *s1,
100 /*@unique@*/ void *s2, int c, size_t n)
103 extern int strcasecmp (char *s1, char *s2) /*@*/ ;
104 extern int strncasecmp (char *s1, char *s2, int n) /*@*/ ;
105 extern /*@null@*/ /*@only@*/ char *strdup (char *s) /*@*/ ;
107 extern /*@null@*/ /*@dependent@*/ char *
108 index (/*@returned@*/ char *s, char c) /*@*/ ;
110 extern /*@null@*/ /*@dependent@*/ char *
111 rindex (/*@returned@*/ char *s, char c) /*@*/ ;
114 extern double cbrt (double x) /*@modifies errno@*/ ;
115 extern double rint (double x) /*@*/ ;
116 extern double trunc (double x) /*@*/ ;
118 /*@constant int ENOTBLK@*/
119 /*@constant int ETXTBSY@*/
120 /*@constant int EWOULDBLOCK@*/
121 /*@constant int EINPROGRESS@*/
122 /*@constant int EALREADY@*/
123 /*@constant int ENOTSOCK@*/
124 /*@constant int EDESTADDRREQ@*/
125 /*@constant int EMSGSIZE@*/
126 /*@constant int EPROTOTYPE@*/
127 /*@constant int ENOPROTOOPT@*/
128 /*@constant int EPROTONOSUPPORT@*/
129 /*@constant int ESOCKTNOSUPPORT@*/
130 /*@constant int EOPNOTSUPP@*/
131 /*@constant int EPFNOSUPPORT@*/
132 /*@constant int EAFNOSUPPORT@*/
133 /*@constant int EADDRINUSE@*/
134 /*@constant int EADDRNOTAVAIL@*/
135 /*@constant int ENETDOWN@*/
136 /*@constant int ENETUNREACH@*/
137 /*@constant int ENETRESET@*/
138 /*@constant int ECONNABORTED@*/
139 /*@constant int ECONNRESET@*/
140 /*@constant int ENOBUFS@*/
141 /*@constant int EISCONN@*/
142 /*@constant int ENOTCONN@*/
143 /*@constant int ESHUTDOWN@*/
144 /*@constant int ETOOMANYREFS@*/
145 /*@constant int ETIMEDOUT@*/
146 /*@constant int ECONNREFUSED@*/
147 /*@constant int ENAMETOOLONG@*/
148 /*@constant int EHOSTDOWN@*/
149 /*@constant int EHOSTUNREACH@*/
150 /*@constant int ENOTEMPTY@*/
151 /*@constant int EPROCLIM@*/
152 /*@constant int EUSERS@*/
153 /*@constant int EDQUOT@*/
154 /*@constant int ESTALE@*/
155 /*@constant int EREMOTE@*/
156 /*@constant int ENOMSG@*/
157 /*@constant int EIDRM@*/
158 /*@constant int EALIGN@*/
159 /*@constant int EDEADLK@*/
160 /*@constant int ENOLCK@*/
161 /*@constant int ENOSYS@*/
162 /*@constant int EACTIVE@*/
163 /*@constant int ENOACTIVE@*/
164 /*@constant int ENORESOURCES@*/
165 /*@constant int ENOSYSTEM@*/
166 /*@constant int ENODUST@*/
167 /*@constant int EDUPNOCONN@*/
168 /*@constant int EDUPNODISCONN@*/
169 /*@constant int EDUPNOTCNTD@*/
170 /*@constant int EDUPNOTIDLE@*/
171 /*@constant int EDUPNOTWAIT@*/
172 /*@constant int EDUPNOTRUN@*/
173 /*@constant int EDUPBADOPCODE@*/
174 /*@constant int EDUPINTRANSIT@*/
175 /*@constant int EDUPTOOMANYCPUS@*/
176 /*@constant int ELOOP@*/
178 /*@constant int LOCK_MAX@*/
179 /*@constant int FCHR_MAX@*/
180 /*@constant int USI_MAX@*/
181 /*@constant int WORD_BIT@*/
182 /*@constant int LONG_BIT@*/
184 /*@-incondefs@*/ /* some constant are also declared in posix.h*/
186 /*@constant long NAME_MAX@*/
188 /*@constant long NGROUPS_MAX@*/
190 /*@constant long MAX_CANON@*/
191 /*@constant int MAX_CHAR@*/
192 /*@constant long OPEN_MAX@*/
193 /*@constant int PASS_MAX@*/
195 /*@constant int PID_MAX@*/
196 /*@constant int SYSPID_MAX@*/
197 /*@constant long PIPE_BUF@*/
199 /*@constant int PIPE_MAX@*/
200 /*@constant int PROC_MAX@*/
201 /*@constant int STD_BLK@*/
202 /*@constant int SYS_NMLN@*/
203 /*@constant int SYS_OPEN@*/
204 /*@constant int NZERO@*/
205 /*@constant int UID_MAX@*/
206 /*@constant long MB_LEN_MAX@*/
207 /*@constant int NL_ARGMAX@*/
208 /*@constant int NL_MSGMAX@*/
209 /*@constant int NL_NMAX@*/
210 /*@constant int NL_SETMAX@*/
211 /*@constant int NL_TEXTMAX@*/
212 /*@constant int NL_LBLMAX@*/
213 /*@constant int NL_LANGMAX @*/
215 /*@constant double M_E@*/
216 /*@constant double M_LOG2E@*/
217 /*@constant double M_LOG10E@*/
218 /*@constant double M_LN2@*/
219 /*@constant double M_LN10@*/
220 /*@constant double M_PI@*/
221 /*@constant double M_PI_2@*/
222 /*@constant double M_PI_4@*/
223 /*@constant double M_1_PI@*/
224 /*@constant double M_2_PI@*/
225 /*@constant double M_2_SQRTPI@*/
226 /*@constant double M_SQRT2@*/
227 /*@constant double M_SQRT1_2@*/
229 /*@constant double MAXFLOAT@*/
230 /*@constant double HUGE@*/
232 /*@constant int DOMAIN@*/
233 /*@constant int SING@*/
234 /*@constant int OVERFLOW@*/
235 /*@constant int UNDERFLOW@*/
236 /*@constant int TLOSS@*/
237 /*@constant int PLOSS@*/
239 extern /*@unchecked@*/ int daylight;
240 extern /*@unchecked@*/ long timezone;
241 extern /*@unchecked@*/ char *tzname[];
244 extern void tzset(void) /*@modifies daylight, timezone, tzname@*/ ;
247 /*@-redef@*/ /* Defined by ansi: */
248 typedef /*@integraltype@*/ key_t;
249 /*@-incondefs@*/ typedef long timer_t; /*@=incondefs@*/
252 typedef unsigned char uchar_t;
253 typedef unsigned short ushort_t;
254 typedef unsigned int uint_t;
255 typedef unsigned long ulong_t;
256 typedef volatile unsigned char vuchar_t;
257 typedef volatile unsigned short vushort_t;
258 typedef volatile unsigned int vuint_t;
259 typedef volatile unsigned long vulong_t;
260 typedef long label_t;
262 typedef /*@integraltype@*/ daddr_t;
263 typedef char *caddr_t;
264 typedef long *qaddr_t;
265 typedef char *addr_t;
266 typedef long physadr_t;
269 typedef unsigned long rlim_t;
272 typedef char slab_t[12];
273 typedef ulong_t shmatt_t;
274 typedef ulong_t msgqnum_t;
275 typedef ulong_t msglen_t;
276 typedef uchar_t uchar;
277 typedef ushort_t ushort;
279 typedef ulong_t ulong;
280 typedef uchar_t u_char;
281 typedef ushort_t u_short;
282 typedef uint_t u_int;
283 typedef ulong_t u_long;
284 typedef vuchar_t vu_char;
285 typedef vushort_t vu_short;
286 typedef vuint_t vu_int;
287 typedef vulong_t vu_long;
288 typedef long swblk_t;
289 typedef u_long fixpt_t;
290 typedef long segsz_t;
291 typedef /*@abstract@*/ fd_set;
293 int ttyname_r (int fg, /*@out@*/ char *buffer, int len) /*@modifies buffer@*/ ;
294 int ioctl (int d, int /*@alt long@*/ request, /*@out@*/ void *arg)
295 /*@modifies *arg, errno@*/ ; /* depends on request! */
297 pid_t vfork (void) /*@modifies fileSystem@*/ ;
305 /*@constant int UIO_MAXIOV@*/ /* BSD */
306 /*@constant int IOV_MAX@*/ /* supposedly SVR4 */
309 readv (int fd, const struct iovec iov[], int iovcnt)
310 /*@modifies iov[].iov_base, fileSystem, errno@*/;
313 writev (int fd, const struct iovec iov[], int iovcnt)
314 /*@modifies errno@*/;
316 /*________________________________________________________________________
326 /*@constant short POLLIN@*/
327 /*@constant short POLLRDNORM@*/
328 /*@constant short POLLRDBAND@*/
329 /*@constant short POLLPRI@*/
330 /*@constant short POLLOUT@*/
331 /*@constant short POLLWRNORM@*/
332 /*@constant short POLLWRBAND@*/
333 /*@constant short POLLERR@*/
334 /*@constant short POLLHUP@*/
335 /*@constant short POLLNVAL@*/
337 extern int poll (struct poll pollfd[], unsigned long nfds, int timeout)
338 /*@modifies pollfd[].revents, errno@*/ ;
341 ** free does not take null
345 extern void free (/*@notnull@*/ /*@out@*/ /*@only@*/ void *p) /*@modifies *p@*/ ;
348 /*________________________________________________________________________
352 /*@constant int SOCK_STREAM@*/
353 /*@constant int SOCK_DGRAM@*/
354 /*@constant int SOCK_RAW@*/
355 /*@constant int SOCK_RDM@*/
356 /*@constant int SOCK_SEQPACKET@*/
357 /*@constant int SO_DEBUG@*/
358 /*@constant int SO_ACCEPTCONN@*/
359 /*@constant int SO_REUSEADDR@*/
360 /*@constant int SO_KEEPALIVE@*/
361 /*@constant int SO_DONTROUTE@*/
362 /*@constant int SO_BROADCAST@*/
363 /*@constant int SO_USELOOPBACK@*/
364 /*@constant int SO_LINGER@*/
365 /*@constant int SO_OOBINLINE@*/
366 /*@constant int SO_REUSEPORT@*/
367 /*@constant int SO_SNDBUF@*/
368 /*@constant int SO_RCVBUF@*/
369 /*@constant int SO_SNDLOWAT@*/
370 /*@constant int SO_RCVLOWAT@*/
371 /*@constant int SO_SNDTIMEO@*/
372 /*@constant int SO_RCVTIMEO@*/
373 /*@constant int SO_ERROR@*/
374 /*@constant int SO_TYPE@*/
375 /*@constant int SOL_SOCKET@*/
376 /*@constant int AF_UNSPEC@*/
377 /*@constant int AF_LOCAL@*/
378 /*@constant int AF_UNIX@*/
379 /*@constant int AF_INET@*/
380 /*@constant int AF_IMPLINK@*/
381 /*@constant int AF_PUP@*/
382 /*@constant int AF_CHAOS@*/
383 /*@constant int AF_NS@*/
384 /*@constant int AF_ISO@*/
385 /*@constant int AF_OSI@*/
386 /*@constant int AF_ECMA@*/
387 /*@constant int AF_DATAKIT@*/
388 /*@constant int AF_CCITT@*/
389 /*@constant int AF_SNA@*/
390 /*@constant int AF_DECnet@*/
391 /*@constant int AF_DLI@*/
392 /*@constant int AF_LAT@*/
393 /*@constant int AF_HYLINK@*/
394 /*@constant int AF_APPLETALK@*/
395 /*@constant int AF_ROUTE@*/
396 /*@constant int AF_LINK@*/
397 /*@constant int pseudo_AF_XTP@*/
398 /*@constant int AF_COIP@*/
399 /*@constant int AF_CNT@*/
400 /*@constant int pseudo_AF_RTIP@*/
401 /*@constant int AF_IPX@*/
402 /*@constant int AF_SIP@*/
403 /*@constant int pseudo_AF_PIP@*/
404 /*@constant int AF_ISDN@*/
405 /*@constant int AF_E164@*/
406 /*@constant int AF_MAX@*/
407 /*@constant int MSG_OOB@*/
408 /*@constant int MSG_PEEK@*/
409 /*@constant int MSG_DONTROUTE@*/
410 /*@constant int MSG_EOR@*/
411 /*@constant int MSG_TRUNC@*/
412 /*@constant int MSG_CTRUNC@*/
413 /*@constant int MSG_WAITALL@*/
414 /*@constant int MSG_DONTWAIT@*/
415 /*@constant int MSG_EOF@*/
416 /*@constant int MSG_COMPAT@*/
417 /*@constant int PF_UNSPEC@*/
418 /*@constant int PF_LOCAL@*/
419 /*@constant int PF_UNIX@*/
420 /*@constant int PF_INET@*/
421 /*@constant int PF_IMPLINK@*/
422 /*@constant int PF_PUP@*/
423 /*@constant int PF_CHAOS@*/
424 /*@constant int PF_NS@*/
425 /*@constant int PF_ISO@*/
426 /*@constant int PF_OSI@*/
427 /*@constant int PF_ECMA@*/
428 /*@constant int PF_DATAKIT@*/
429 /*@constant int PF_CCITT@*/
430 /*@constant int PF_SNA@*/
431 /*@constant int PF_DECnet@*/
432 /*@constant int PF_DLI@*/
433 /*@constant int PF_LAT@*/
434 /*@constant int PF_HYLINK@*/
435 /*@constant int PF_APPLETALK@*/
436 /*@constant int PF_ROUTE@*/
437 /*@constant int PF_LINK@*/
438 /*@constant int PF_XTP@*/
439 /*@constant int PF_COIP@*/
440 /*@constant int PF_CNT@*/
441 /*@constant int PF_SIP@*/
442 /*@constant int PF_IPX@*/
443 /*@constant int PF_RTIP@*/
444 /*@constant int PF_PIP@*/
445 /*@constant int PF_ISDN@*/
446 /*@constant int PF_MAX@*/
447 /*@constant int NET_MAXID@*/
448 /*@constant int NET_RT_DUMP@*/
449 /*@constant int NET_RT_FLAGS@*/
450 /*@constant int NET_RT_IFLIST@*/
451 /*@constant int NET_RT_MAXID@*/
452 /*@constant int SOMAXCONN@*/
453 /*@constant int SCM_RIGHTS@*/
456 u_char sa_len; /* total length */
457 u_char sa_family; /* address family */
458 char sa_data[14]; /* actually longer; address value */
462 int l_onoff; /* option on/off */
463 int l_linger; /* linger time */
467 u_short sp_family; /* address family */
468 u_short sp_protocol; /* protocol */
471 caddr_t msg_name; /* optional address */
472 u_int msg_namelen; /* size of address */
473 struct iovec *msg_iov; /* scatter/gather array */
474 u_int msg_iovlen; /* # elements in msg_iov */
475 caddr_t msg_control; /* ancillary data, see below */
476 u_int msg_controllen; /* ancillary data buffer len */
477 int msg_flags; /* flags on received message */
481 u_int cmsg_len; /* data byte count, including hdr */
482 int cmsg_level; /* originating protocol */
483 int cmsg_type; /* protocol-specific type */
484 /* followed by u_char cmsg_data[]; */
488 accept (int s, struct sockaddr *addr, int *addrlen)
489 /*@modifies *addrlen, errno@*/;
492 bind (int s, struct sockaddr *name, int namelen)
493 /*@modifies errno, fileSystem@*/;
496 connect (int s, struct sockaddr *name, int namelen)
497 /*@modifies errno, internalState@*/;
499 int getpeername (int s, /*@out@*/ struct sockaddr *name, size_t *namelen)
500 /*@modifies *name, *namelen, errno@*/;
502 typedef /*@unsignedintegraltype@*/ socklen_t;
506 int getsockname (int s, /*@out@*/ struct sockaddr *address, socklen_t *address_len)
507 /*@i556@*/ /*: can't do this? requires maxSet(address) >= (*address_len) @*/
508 /*@modifies *address, *address_len, errno@*/;
511 int getsockname (int s, /*@out@*/ struct sockaddr *address, socklen_t /*@alt size_t@*/ *address_len)
512 /*@i556@*/ /*: can't do this? requires maxSet(address) >= (*address_len) @*/
513 /*@modifies *address, *address_len, errno@*/;
517 int getsockopt (int s, int level, int optname, /*@out@*/ void *optval, size_t *optlen)
518 /*@modifies *optval, *optlen, errno@*/;
521 listen (int s, int backlog)
522 /*@modifies errno, internalState@*/;
525 recv (int s, /*@out@*/ void *buf, size_t len, int flags)
526 /*@modifies *buf, errno@*/;
529 recvfrom (int s, void *buf, size_t len, int flags, /*@null@*/ struct sockaddr *from, int *fromlen)
530 /*@modifies *buf, *from, *fromlen, errno@*/;
533 recvmsg (int s, struct msghdr *msg, int flags)
534 /*@modifies msg->msg_iov->iov_base[], errno@*/;
537 send (int s, const void *msg, size_t len, int flags)
538 /*@modifies errno@*/;
541 sendto (int s, const void *msg, size_t len, int flags, const struct sockaddr *to, int tolen)
542 /*@modifies errno@*/;
545 sendmsg (int s, const struct msghdr *msg, int flags)
546 /*@modifies errno@*/;
549 setsockopt (int s, int level, int optname, const void *optval, int optlen)
550 /*@modifies internalState, errno@*/;
553 shutdown (int s, int how)
554 /*@modifies errno@*/;
557 socket (int domain, int type, int protocol)
558 /*@modifies errno@*/;
561 socketpair (int d, int type, int protocol, /*@out@*/ int *sv)
562 /*@modifies errno@*/;
564 /*@constant int BADSIG@*/
565 /*@constant int SA_ONSTACK@*/
566 /*@constant int SA_RESTART@*/
567 /*@constant int SA_DISABLE@*/
568 /*@constant int SIGBUS@*/
569 /*@constant int SIGEMT@*/
570 /*@constant int SIGINFO@*/
571 /*@constant int SIGIO@*/
572 /*@constant int SIGIOT@*/
573 /*@constant int SIGPOLL@*/
574 /*@constant int SIGPROF@*/
575 /*@constant int SIGPWR@*/
576 /*@constant int SIGSYS@*/
577 /*@constant int SIGTRAP@*/
578 /*@constant int SIGURG@*/
579 /*@constant int SIGVTALRM@*/
580 /*@constant int SIGWINCH@*/
581 /*@constant int SIGXCPU@*/
582 /*@constant int SIGXFSZ@*/
584 extern void psignal (int sig, const char *msg)
585 /*@modifies fileSystem@*/;
588 setenv (const char *name, const char *value, int overwrite)
589 /*@globals environ@*/
590 /*@modifies *environ, errno@*/;
593 unsetenv (const char *name)
594 /*@globals environ@*/
595 /*@modifies *environ@*/;
597 /*________________________________________________________________________
606 W_EXITCODE (int ret, int sig)
613 /*@constant int WAIT_ANY@*/
614 /*@constant int WAIT_MYPGRP@*/
615 /*@constant int WSTOPPED@*/
618 wait3 (int *statloc, int options, /*@null@*/ /*@out@*/ struct rusage *rusage)
619 /*@modifies *statloc, *rusage, errno@*/;
622 wait4 (pid_t p, int *statloc, int opt, /*@null@*/ /*@out@*/ struct rusage *r)
623 /*@modifies *statloc, *r, errno@*/;
640 /*@constant int DST_NONE@*/
641 /*@constant int DST_USA@*/
642 /*@constant int DST_AUST@*/
643 /*@constant int DST_WET@*/
644 /*@constant int DST_MET@*/
645 /*@constant int DST_EET@*/
646 /*@constant int DST_CAN@*/
648 /*@constant int ITIMER_PROF@*/
649 /*@constant int ITIMER_REAL@*/
650 /*@constant int ITIMER_VIRTUAL@*/
653 struct timeval it_interval;
654 struct timeval it_value;
665 adjtime (const struct timeval *delta, /*@null@*/ /*@out@*/ struct timeval *olddelta)
666 /*@modifies internalState, *olddelta, errno@*/;
669 getitimer (int which, /*@out@*/ struct itimerval *value)
670 /*@modifies errno, *value*/;
673 gettimeofday (/*@null@*/ /*@out@*/ struct timeval *tp, /*@null@*/ /*@out@*/ struct timezone *tzp)
674 /*@modifies *tp, *tzp, errno@*/;
677 setitimer (int which, struct itimerval *val, /*@null@*/ /*@out@*/ struct itimerval *oval)
678 /*@modifies *oval, errno, internalState*/;
681 settimeofday (const struct timeval *t, const struct timezone *z)
682 /*@modifies internalState, errno@*/;
685 utimes (const char *file, /*@null@*/ const struct timeval *times)
686 /*@modifies fileSystem, errno*/;
688 /*________________________________________________________________________
692 /*@constant int PROT_READ@*/
693 /*@constant int PROT_WRITE@*/
694 /*@constant int PROT_EXEC@*/
695 /*@constant int MAP_SHARED@*/
696 /*@constant int MAP_PRIVATE@*/
697 /*@constant int MAP_COPY@*/
698 /*@constant int MAP_FIXED@*/
699 /*@constant int MAP_RENAME@*/
700 /*@constant int MAP_NORESERVE@*/
701 /*@constant int MAP_INHERIT@*/
702 /*@constant int MAP_NOEXTEND@*/
703 /*@constant int MAP_HASSEMAPHORE@*/
704 /*@constant int MS_ASYNC@*/
705 /*@constant int MS_INVALIDATE@*/
706 /*@constant int MAP_FILE@*/
707 /*@constant int MAP_ANON@*/
708 /*@constant int MADV_NORMAL@*/
709 /*@constant int MADV_RANDOM@*/
710 /*@constant int MADV_SEQUENTIAL@*/
711 /*@constant int MADV_WILLNEED@*/
712 /*@constant int MADV_DONTNEED@*/
715 mmap (/*@null@*/ /*@returned@*/ caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
719 madvise (caddr_t addr, int len, int behav)
723 mprotect (caddr_t addr, int len, int prot)
727 int munmap (/*@only@*/ caddr_t addr, size_t len)
728 /*@modifies fileSystem, *addr, errno @*/;
731 msync (caddr_t addr, int len, int flags)
735 mlock (caddr_t addr, size_t len)
739 munlock (caddr_t addr, size_t len)
743 /*________________________________________________________________________
748 unsigned short ws_row;
749 unsigned short ws_col;
750 unsigned short ws_xpixel;
751 unsigned short ws_ypixel;
754 /*@constant int TIOCMODG@*/
755 /*@constant int TIOCMODS@*/
756 /*@constant int TIOCM_LE@*/
757 /*@constant int TIOCM_DTR@*/
758 /*@constant int TIOCM_RTS@*/
759 /*@constant int TIOCM_ST@*/
760 /*@constant int TIOCM_SR@*/
761 /*@constant int TIOCM_CTS@*/
762 /*@constant int TIOCM_CAR@*/
763 /*@constant int TIOCM_CD@*/
764 /*@constant int TIOCM_RNG@*/
765 /*@constant int TIOCM_RI@*/
766 /*@constant int TIOCM_DSR@*/
767 /*@constant int TIOCEXCL@*/
768 /*@constant int TIOCNXCL@*/
769 /*@constant int TIOCFLUSH@*/
770 /*@constant int TIOCGETA@*/
771 /*@constant int TIOCSETA@*/
772 /*@constant int TIOCSETAW@*/
773 /*@constant int TIOCSETAF@*/
774 /*@constant int TIOCGETD@*/
775 /*@constant int TIOCSETD@*/
776 /*@constant int TIOCSBRK@*/
777 /*@constant int TIOCCBRK@*/
778 /*@constant int TIOCSDTR@*/
779 /*@constant int TIOCCDTR@*/
780 /*@constant int TIOCGPGRP@*/
781 /*@constant int TIOCSPGRP@*/
782 /*@constant int TIOCOUTQ@*/
783 /*@constant int TIOCSTI@*/
784 /*@constant int TIOCNOTTY@*/
785 /*@constant int TIOCPKT@*/
786 /*@constant int TIOCPKT_DATA@*/
787 /*@constant int TIOCPKT_FLUSHREAD@*/
788 /*@constant int TIOCPKT_FLUSHWRITE@*/
789 /*@constant int TIOCPKT_STOP@*/
790 /*@constant int TIOCPKT_START@*/
791 /*@constant int TIOCPKT_NOSTOP@*/
792 /*@constant int TIOCPKT_DOSTOP@*/
793 /*@constant int TIOCPKT_IOCTL@*/
794 /*@constant int TIOCSTOP@*/
795 /*@constant int TIOCSTART@*/
796 /*@constant int TIOCMSET@*/
797 /*@constant int TIOCMBIS@*/
798 /*@constant int TIOCMBIC@*/
799 /*@constant int TIOCMGET@*/
800 /*@constant int TIOCREMOTE@*/
801 /*@constant int TIOCGWINSZ@*/
802 /*@constant int TIOCSWINSZ@*/
803 /*@constant int TIOCUCNTL@*/
804 /*@constant int TIOCSTAT@*/
805 /*@constant int TIOCCONS@*/
806 /*@constant int TIOCSCTTY@*/
807 /*@constant int TIOCEXT@*/
808 /*@constant int TIOCSIG@*/
809 /*@constant int TIOCDRAIN@*/
810 /*@constant int TIOCMSDTRWAIT@*/
811 /*@constant int TIOCMGDTRWAIT@*/
812 /*@constant int TIOCTIMESTAMP@*/
813 /*@constant int TIOCSDRAINWAIT@*/
814 /*@constant int TIOCGDRAINWAIT@*/
815 /*@constant int TTYDISC@*/
816 /*@constant int TABLDISC@*/
817 /*@constant int SLIPDISC@*/
818 /*@constant int PPPDISC@*/
820 /*@constant int MAXHOSTNAMELEN@*/
823 FD_CLR (int n, fd_set *p)
827 FD_COPY (fd_set *f, /*@out@*/ fd_set *t)
830 extern int /*@alt lltX_bool@*/
831 FD_ISSET (int n, fd_set *p)
835 FD_SET (int n, fd_set *p)
839 FD_ZERO (fd_set /*@out@*/ *p)
844 /*@modifies internalState, errno@*/;
847 fchown (int fd, uid_t owner, gid_t group)
848 /*@modifies errno, fileSystem@*/;
852 /*@modifies errno, fileSystem@*/;
855 ftruncate (int fd, off_t length)
856 /*@modifies errno, fileSystem@*/;
858 int gethostname (/*@out@*/ char *address, size_t address_len)
860 /*@modifies address@*/ ;
862 int initgroups (const char *name, int basegid)
863 /*@modifies internalState@*/;
866 lchown (const char *path, uid_t owner, gid_t group)
867 /*@modifies errno, fileSystem@*/;
870 readlink (const char *path, /*@out@*/ char *buf, int size)
871 /*@modifies *buf, errno@*/
873 /*@requires maxSet(buf) >= (size - 1) @*/
874 /*@ensures result <= size @*/;
877 select (int mfd, fd_set /*@null@*/ *r, fd_set /*@null@*/ *w, fd_set /*@null@*/ *e, struct timeval *t)
878 /*@modifies *r, *w, *e, *t, errno@*/;
882 /*@modifies errno, internalState@*/;
886 /*@modifies errno, internalState@*/;
889 setgroups (int ngroups, const gid_t *gidset)
890 /*@modifies errno, internalState@*/;
893 setregid (gid_t rgid, gid_t egid)
894 /*@modifies errno, internalState@*/;
897 setreuid (gid_t ruid, gid_t euid)
898 /*@modifies errno, internalState@*/;
902 /*@modifies fileSystem@*/;
905 symlink (const char *path, const char *path2)
906 /*@modifies fileSystem@*/;
909 truncate (const char *name, off_t length)
910 /*@modifies errno, fileSystem@*/;
912 /*@constant int EBADRPC@*/
913 /*@constant int ERPCMISMATCH@*/
914 /*@constant int EPROGUNAVAIL@*/
915 /*@constant int EPROGMISMATCH@*/
916 /*@constant int EPROCUNAVAIL@*/
917 /*@constant int EFTYPE@*/
918 /*@constant int EAUTH@*/
919 /*@constant int ENEEDAUTH@*/
920 /*@constant int ELAST@*/
926 /*@unchecked@*/ extern char *TMAGIC;
927 /*@constant int TMAGLEN@*/
928 /*@unchecked@*/ extern char *TVERSION;
929 /*@constant int TVERSLEN@*/
931 /*@constant int REGTYPE@*/
932 /*@constant int AREGTYPE@*/
933 /*@constant int LNKTYPE@*/
934 /*@constant int SYMTYPE@*/
935 /*@constant int CHRTYPE@*/
936 /*@constant int BLKTYPE@*/
937 /*@constant int DIRTYPE@*/
938 /*@constant int FIFOTYPE@*/
939 /*@constant int CONTTYPE@*/
941 /*@constant int TSUID@*/
942 /*@constant int TSGID@*/
943 /*@constant int TSVTX@*/
945 /*@constant int TUREAD@*/
946 /*@constant int TUWRITE@*/
947 /*@constant int TUEXEC@*/
948 /*@constant int TGREAD@*/
949 /*@constant int TGWRITE@*/
950 /*@constant int TGEXEC@*/
951 /*@constant int TOREAD@*/
952 /*@constant int TOWRITE@*/
953 /*@constant int TOEXEC@*/
956 uid_t uid; /* user id */
957 gid_t gid; /* group id */
958 uid_t cuid; /* creator user id */
959 gid_t cgid; /* creator group id */
960 mode_t mode; /* r/w permission */
961 ulong seq; /* slot usage sequence number */
962 key_t key; /* user specified msg/sem/shm key */
965 /*@constant int IPC_R@*/
966 /*@constant int IPC_W@*/
967 /*@constant int IPC_M@*/
968 /*@constant int IPC_CREAT@*/
969 /*@constant int IPC_EXCL@*/
970 /*@constant int IPC_NOWAIT@*/
971 /*@constant key_t IPC_PRIVATE@*/
972 /*@constant int IPC_RMID@*/
973 /*@constant int IPC_SET@*/
974 /*@constant int IPC_STAT@*/
981 struct ipc_perm msg_perm; /* msg queue permission bits */
982 struct msg *msg_first; /* first message in the queue */
983 struct msg *msg_last; /* last message in the queue */
984 u_long msg_cbytes; /* number of bytes in use on the queue */
985 u_long msg_qnum; /* number of msgs in the queue */
986 u_long msg_qbytes; /* max # of bytes on the queue */
987 pid_t msg_lspid; /* pid of last msgsnd() */
988 pid_t msg_lrpid; /* pid of last msgrcv() */
989 time_t msg_stime; /* time of last msgsnd() */
990 time_t msg_rtime; /* time of last msgrcv() */
991 time_t msg_ctime; /* time of last msgctl() */
995 long mtype; /* message type (+ve integer) */
996 char mtext[]; /* message body */
999 /*@constant int MSG_NOERROR@*/
1000 /*@constant int MSGMAX@*/
1001 /*@constant int MSGMNB@*/
1002 /*@constant int MSGMNI@*/
1003 /*@constant int MSGTQL@*/
1006 msgctl (int id , int cmd, /*@out@*/ struct msqid_ds *buf)
1007 /*@modifies errno, *buf@*/;
1010 msgget (key_t key, int flag)
1011 /*@modifies errno@*/;
1014 msgrcv (int id, /*@out@*/ void *ptr, size_t nbytes, long type, int flags)
1015 /*@modifies errno, *ptr@*/;
1018 msgsnd (int id, const void *ptr, size_t nbytes, int flag)
1019 /*@modifies errno@*/;
1026 struct ipc_perm sem_perm;
1027 struct sem *sem_base;
1042 struct semid_ds *buf;
1052 /*@constant int SEM_A@*/
1053 /*@constant int SEMAEM@*/
1054 /*@constant int SEMMNI@*/
1055 /*@constant int SEMMNS@*/
1056 /*@constant int SEMMNU@*/
1057 /*@constant int SEMMSL@*/
1058 /*@constant int SEMOPN@*/
1059 /*@constant int SEM_R@*/
1060 /*@constant int SEMUME@*/
1061 /*@constant int SEM_UNDO@*/
1062 /*@constant int SEMVMX@*/
1063 /*@constant int GETVAL@*/
1064 /*@constant int SETVAL@*/
1065 /*@constant int GETPID@*/
1066 /*@constant int GETNCNT@*/
1067 /*@constant int GETZCNT@*/
1068 /*@constant int GETALL@*/
1069 /*@constant int SETALL@*/
1071 /*@constant int ERMID@*/
1074 semctl (int id, int semnum, int cmd, union semun arg)
1075 /*@modifies errno@*/;
1078 semget (key_t key, int nsems, int flag)
1079 /*@modifies errno@*/;
1082 semop (int id, struct sembuf *semoparray, size_t nops)
1083 /*@modifies errno@*/;
1090 struct ipc_perm shm_perm;
1102 /*@constant int SHMLBA@*/
1103 /*@constant int SHM_LOCK@*/
1104 /*@constant int SHMMAX@*/
1105 /*@constant int SHMMIN@*/
1106 /*@constant int SHMMNI@*/
1107 /*@constant int SHM_R@*/
1108 /*@constant int SHM_RDONLY@*/
1109 /*@constant int SHM_RND@*/
1110 /*@constant int SHMSEG@*/
1111 /*@constant int SHM_W@*/
1112 /*@constant int SHM_UNLOCK@*/
1114 void * shmat (int id, /*@null@*/ void *addr, int flag)
1115 /*@modifies errno@*/ ;
1117 extern int shmctl (int id, int cmd, /*@out@*/ struct shmid_ds *buf)
1118 /*@modifies errno, *buf@*/ ;
1120 extern int shmdt (void *addr)
1121 /*@modifies errno@*/ ;
1123 extern int shmget (key_t key, int size, int flag)
1124 /*@modifies errno@*/ ;
1128 ** this is in stdio.h!
1136 ** evans 2001-12-30: added from http://www.opengroup.org/onlinepubs/007908799/xsh/stdio.h.html
1139 /*@constant unsignedintegraltype BUFSIZ@*/
1140 /*@constant unsignedintegraltype FILENAME_MAX@*/
1141 /*@constant unsignedintegraltype FOPEN_MAX@*/
1142 /*@constant bool _IOFBF@*/
1143 /*@constant bool _IOLBF@*/
1144 /*@constant bool _IONBF@*/
1145 /*@constant unsignedintegraltype L_ctermid@*/
1146 /*@constant unsignedintegraltype L_cuserid@*/
1147 /*@constant unsignedintegraltype L_tmpnam@*/
1148 /*@constant unsignedintegraltype SEEK_CUR@*/
1149 /*@constant unsignedintegraltype SEEK_END@*/
1150 /*@constant unsignedintegraltype SEEK_SET@*/
1151 /*@constant unsignedintegraltype TMP_MAX@*/
1156 /*@constant observer char *P_tmpdir@*/
1158 /*@dependent@*/ char *ctermid (/*@returned@*/ /*@null@*/ char *) /*@*/ ;
1159 /* Result may be static pointer if parameter is NULL, otherwise is fresh. */
1161 char *cuserid (/*@null@*/ /*@returned@*/ char *)
1162 /*@warn legacy "cuserid is obsolete"@*/ /*@*/ ;
1164 /*@null@*/ FILE *fdopen (int, const char *)
1165 /*@modifies errno, fileSystem@*/ ;
1167 int fileno (/*@notnull@*/ FILE *)
1169 /*@modifies errno@*/ ;
1171 void flockfile (/*@notnull@*/ FILE *f)
1172 /*@modifies f, fileSystem@*/ ;
1174 int fseeko (FILE *stream, off_t offset, int whence)
1176 /*@modifies stream, errno@*/ ;
1178 off_t ftello(FILE *stream)
1179 /*:errorcode -1:*/ /*@modifies errno*/ ;
1181 int ftrylockfile(FILE *stream)
1183 /*@modifies stream, fileSystem, errno*/ ;
1185 void funlockfile (FILE *stream)
1186 /*@modifies stream, fileSystem*/ ;
1188 int getc_unlocked(FILE *stream)
1189 /*@warn multithreaded "getc_unlocked is a thread unsafe version of getc"@*/
1190 /*@modifies *stream, fileSystem, errno@*/ ;
1192 int getchar_unlocked (void)
1193 /*@warn multithreaded "getchar_unlocked is a thread unsafe version of getchar"@*/
1195 /*@modifies *stdin, fileSystem@*/ ;
1197 int getopt (int, char * const[], const char)
1200 int getw (FILE *stream)
1202 /*@modifies fileSystem, *stream, errno@*/ ;
1204 int pclose(FILE *stream)
1206 /*@modifies *stream, errno@*/ ;
1208 /*@null@*/ FILE *popen (const char *command, const char *mode)
1209 /*:errorcode NULL:*/
1210 /*@modifies fileSystem, errno@*/ ;
1212 int putc_unlocked (int, FILE *stream)
1213 /*@warn multithreaded "putc_unlocked is a thread unsafe version of putc"@*/
1215 /*@modifies fileSystem, *stream, errno@*/ ;
1217 int putchar_unlocked(int)
1218 /*@warn multithreaded "putchar_unlocked is a thread unsafe version of putchar"@*/
1220 /*@modifies fileSystem, *stdout, errno@*/ ;
1222 int putw(int, FILE *stream)
1224 /*@modifies fileSystem, *stdout, errno@*/ ;
1226 int remove (const char *)
1227 /*@modifies fileSystem@*/ ;
1229 int rename (const char *, const char *)
1230 /*@modifies fileSystem@*/ ;
1232 void rewind (FILE *stream)
1233 /*@modifies *stream@*/ ;
1235 void setbuf (FILE *stream, /*@null@*/ char *buf);
1236 int setvbuf(FILE *, char *, int, size_t);
1237 int snprintf(char *, size_t, const char *, ...);
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@*/
1311 /*@modifies fileSystem@*/;
1314 openlog (const char *ident, int logopt, int facility)
1315 /*@modifies fileSystem@*/;
1318 setlogmask (int maskpri)
1319 /*@modifies internalState@*/;
1321 extern void /*@printflike@*/
1322 syslog (int priority, const char *message, ...)
1323 /*@modifies fileSystem@*/;
1326 vsyslog (int priority, const char *message, va_list args)
1327 /*@modifies fileSystem@*/;
1329 /*________________________________________________________________________
1335 /*@modifies internalState@*/;
1337 extern /*@null@*/ struct passwd *
1339 /*@modifies internalState@*/;
1342 setpassent (int stayopen)
1343 /*@modifies internalState@*/;
1347 /*@modifies internalState@*/;
1349 /*________________________________________________________________________
1355 /*@modifies internalState@*/;
1357 extern /*@null@*/ struct group *
1359 /*@modifies internalState@*/;
1363 /*@modifies internalState@*/;
1366 setgrfile (const char *name)
1367 /*@modifies internalState@*/;
1370 setgroupent (int stayopen)
1371 /*@modifies internalState@*/;
1376 ** evans 2001-08-26 - updated from http://www.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html
1380 ** struct stat replaces POSIX version - more required fields in Unix
1383 /*@-redef@*/ /*@-matchfields@*/
1385 dev_t st_dev; /* ID of device containing file */
1386 ino_t st_ino; /* file serial number */
1387 mode_t st_mode; /* mode of file (see below) */
1388 nlink_t st_nlink; /* number of links to the file */
1389 uid_t st_uid; /* user ID of file */
1390 gid_t st_gid; /* group ID of file */
1391 dev_t st_rdev; /* device ID (if file is character or block special) */
1392 off_t st_size; /* file size in bytes (if file is a regular file) */
1393 time_t st_atime; /* time of last access */
1394 time_t st_mtime; /* time of last data modification */
1395 time_t st_ctime; /* time of last status change */
1396 blksize_t st_blksize; /* a filesystem-specific preferred I/O block size for
1397 this object. In some filesystem types, this may
1398 vary from file to file */
1399 blkcnt_t st_blocks; /* number of blocks allocated for this object */
1401 /*@=redef@*/ /*@=matchfields@*/
1403 /*@constant mode_t S_IFMT@*/
1404 /*@constant mode_t S_IFBLK@*/
1405 /*@constant mode_t S_IFCHR@*/
1406 /*@constant mode_t S_IFIFO@*/
1407 /*@constant mode_t S_IFREG@*/
1408 /*@constant mode_t S_IFDIR@*/
1409 /*@constant mode_t S_IFLNK@*/
1411 /*@constant mode_t S_IRWXU@*/
1412 /*@constant mode_t S_IRUSR@*/
1414 /*@-incondefs@*/ /*: probably wrong in posix.h? */
1415 /*@constant mode_t S_IWUSR@*/
1416 /*@constant mode_t S_IXUSR@*/
1417 /*@constant mode_t S_IRWXG@*/
1418 /*@constant mode_t S_IRGRP@*/
1419 /*@constant mode_t S_IWGRP@*/
1420 /*@constant mode_t S_IXGRP@*/
1421 /*@constant mode_t S_IRWXO@*/
1422 /*@constant mode_t S_IROTH@*/
1423 /*@constant mode_t S_IWOTH@*/
1424 /*@constant mode_t S_IXOTH@*/
1425 /*@constant mode_t S_ISUID@*/
1426 /*@constant mode_t S_ISGID@*/
1427 /*@constant mode_t S_ISVTX@*/
1432 /*These are the old definitions - they don't appear to be in the Single UNIX Specification */
1434 /*@constant int S_ISTXT@*/
1435 /*@constant int S_IREAD@*/
1436 /*@constant int S_IWRITE@*/
1437 /*@constant int S_IEXEC@*/
1438 /*@constant int S_IFMT@*/
1439 /*@constant int S_IFIFO@*/
1440 /*@constant int S_IFCHR@*/
1441 /*@constant int S_IFDIR@*/
1442 /*@constant int S_IFBLK@*/
1443 /*@constant int S_IFREG@*/
1444 /*@constant int S_IFLNK@*/
1445 /*@constant int S_IFSOCK@*/
1446 /*@constant int S_ISVTX@*/
1447 /*@constant int S_ISVTX@*/
1448 /*@constant int SF_SETTABLE@*/
1449 /*@constant int SF_ARCHIVED@*/
1450 /*@constant int ACCESSPERMS@*/
1451 /*@constant int ALLPERMS@*/
1452 /*@constant int DEFFILEMODE@*/
1453 /*@constant int S_BLKSIZE@*/
1454 /*@constant int SF_IMMUTABLE@*/
1455 /*@constant int SF_APPEND@*/
1456 /*@constant int UF_NODUMP@*/
1457 /*@constant int UF_IMMUTABLE@*/
1458 /*@constant int UF_APPEND@*/
1461 int /*@alt lltX_bool@*/ S_ISBLK (/*@sef@*/ mode_t m) /*@*/;
1462 int /*@alt lltX_bool@*/ S_ISCHR (/*@sef@*/ mode_t m) /*@*/;
1463 int /*@alt lltX_bool@*/ S_ISDIR (/*@sef@*/ mode_t m) /*@*/;
1464 int /*@alt lltX_bool@*/ S_ISFIFO (/*@sef@*/ mode_t m) /*@*/;
1465 int /*@alt lltX_bool@*/ S_ISREG (/*@sef@*/ mode_t m) /*@*/;
1466 int /*@alt lltX_bool@*/ S_ISLNK (/*@sef@*/ mode_t m) /*@*/;
1468 int /*@alt lltX_bool@*/ S_TYPEISMQ (/*@sef@*/ struct stat *buf) /*@*/ ;
1469 int /*@alt lltX_bool@*/ S_TYPEISSEM (/*@sef@*/ struct stat *buf) /*@*/ ;
1470 int /*@alt lltX_bool@*/ S_TYPEISSHM (/*@sef@*/ struct stat *buf) /*@*/ ;
1472 /* in POSIX: chmod, fstat, mkdir, mkfifo, stat, umask */
1474 int lstat(const char *, /*@out@*/ struct stat *)
1476 /*@modifies errno@*/ ;
1478 int mknod (const char *, mode_t, dev_t)
1479 /*@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."@*/
1481 /*@modifies errno@*/ ;
1483 int chflags (const char *path, u_long flags)
1484 /*@warn unixstandard "Not in Single UNIX Specification Version 2"@*/
1485 /*@modifies fileSystem, errno@*/;
1487 int fchflags (int fd, u_long flags)
1488 /*@warn unixstandard "Not in Single UNIX Specification Version 2"@*/
1489 /*@modifies fileSystem, errno@*/;
1491 /*________________________________________________________________________
1495 /*@constant int FMNAMESZ@*/
1496 /*@constant int MSG_BAND@*/
1497 /*@constant int MSG_HIPRI@*/
1498 /*@constant int RS_HIPRI@*/
1499 /*@constant int S_INPUT@*/
1500 /*@constant int S_RDNORM@*/
1501 /*@constant int S_RDBAND@*/
1502 /*@constant int S_BANDURG@*/
1503 /*@constant int S_HIPRI@*/
1504 /*@constant int S_OUTPUT@*/
1505 /*@constant int S_WRNORM@*/
1506 /*@constant int S_WRBAND@*/
1507 /*@constant int S_MSG@*/
1508 /*@constant int S_ERROR@*/
1509 /*@constant int S_HANGUP@*/
1523 struct str_mlist *sl_modlist;
1527 getmsg (int fd, /*@out@*/ struct strbuf *c, /*@out@*/ struct strbuf *d, int *f)
1528 /*@modifies *c, *d, errno@*/;
1531 getpmsg (int fd, /*@out@*/ struct strbuf *c, /*@out@*/ struct strbuf *d, int *b, int *f)
1532 /*@modifies *b, *c, *d, errno@*/;
1535 putmsg (int fd, const struct strbuf *c, const struct strbuf *d, int *f)
1536 /*@modifies internalState, errno@*/;
1538 extern int putpmsg (int fd, const struct strbuf *c, const struct strbuf *d, int b, int *f)
1539 /*@modifies internalState, errno@*/;
1541 /*________________________________________________________________________
1545 /*@constant int RLIMIT_CPU@*/
1546 /*@constant int RLIMIT_FSIZE@*/
1547 /*@constant int RLIMIT_DATA@*/
1548 /*@constant int RLIMIT_STACK@*/
1549 /*@constant int RLIMIT_CORE@*/
1550 /*@constant int RLIMIT_RSS@*/
1551 /*@constant int RLIMIT_MEMLOCK@*/
1552 /*@constant int RLIMIT_NPROC@*/
1553 /*@constant int RLIMIT_NOFILE@*/
1554 /*@constant int RLIM_NLIMITS@*/
1555 /*@constant int RLIM_INFINITY@*/
1556 /*@constant int PRIO_MIN@*/
1557 /*@constant int PRIO_MAX@*/
1558 /*@constant int PRIO_PROCESS@*/
1559 /*@constant int PRIO_PGRP@*/
1560 /*@constant int PRIO_USER@*/
1561 /*@constant int RUSAGE_SELF@*/
1562 /*@constant int RUSAGE_CHILDREN@*/
1565 struct timeval ru_utime; /* user time used */
1566 struct timeval ru_stime; /* system time used */
1567 long ru_maxrss; /* max resident set size */
1568 long ru_ixrss; /* integral shared memory size */
1569 long ru_idrss; /* integral unshared data " */
1570 long ru_isrss; /* integral unshared stack " */
1571 long ru_minflt; /* page reclaims */
1572 long ru_majflt; /* page faults */
1573 long ru_nswap; /* swaps */
1574 long ru_inblock; /* block input operations */
1575 long ru_oublock; /* block output operations */
1576 long ru_msgsnd; /* messages sent */
1577 long ru_msgrcv; /* messages received */
1578 long ru_nsignals; /* signals received */
1579 long ru_nvcsw; /* voluntary context switches */
1580 long ru_nivcsw; /* involuntary " */
1589 unsigned long ldavg[3];
1594 getpriority (int which, int who)
1595 /*@modifies errno@*/;
1598 getrlimit (int res, /*@out@*/ struct rlimit *rlp)
1599 /*@modifies *rlp, errno@*/;
1602 getrusage (int who, /*@out@*/ struct rusage *rusage)
1603 /*@modifies *rusage, errno@*/;
1606 setpriority (int which, int who, int prio)
1607 /*@modifies errno, internalState@*/;
1610 setrlimit (int resource, const struct rlimit *rlp)
1611 /*@modifies errno, internalState@*/;
1620 /*@observer@*/ char *s_name; /* Official service name. */
1621 /*@observer@*/ char **s_aliases; /* Alias list. */
1622 int s_port; /* Port number. */
1623 /*@observer@*/ char *s_proto; /* Protocol to use. */
1626 /*@observer@*/ /*@dependent@*/ /*@null@*/ struct servent *getservbyname (const char *name, /*@null@*/ const char *proto)
1627 /*@warn multithreaded "Unsafe in multithreaded applications, use getsrvbyname_r instead"@*/ ;
1629 struct servent *getservbyname_r (const char *name, /*@null@*/ const char *proto, /*@out@*/ /*@returned@*/ struct servent *result, /*@out@*/ char *buffer, int buflen)
1630 /*@requires maxSet (buffer) >= buflen@*/ ;
1633 /*@observer@*/ /*@dependent@*/ struct servent *getservbyport (int port, /*@null@*/ const char *proto)
1634 /*@warn multithreaded "Unsafe in multithreaded applications, use getservbyport_r instead"@*/ ;
1636 struct servent *getservbyport_r (int port, /*@null@*/ const char *proto, /*@out@*/ /*@returned@*/ struct servent *result, /*@out@*/ char *buffer, int buflen)
1637 /*@requires maxSet (buffer) >= buflen@*/ ;
1639 /*@null@*/ struct servent *getservent (void);
1641 /*@null@*/ struct servent *getservent_r (struct servent *result, char *buffer, int buflen);
1643 int setservent (int stayopen);
1644 int endservent (void);
1648 /*@null@*/ /*@observer@*/ struct hostent *gethostbyname (/*@nullterminated@*/ /*@notnull@*/ const char *name)
1649 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostbyname_r instead"@*/
1650 /*@modifies h_errno@*/ ;
1652 struct hostent *gethostbyname_r (/*@nullterminated@*/ const char *name, /*@notnull@*/ /*@returned@*/ struct hostent *hent, /*@out@*/ /*@exposed@*/ char *buffer, int bufsize, /*@out@*/ int *h_errnop)
1653 /*@requires maxSet(buffer) >= bufsize@*/ ;
1655 /*@null@*/ /*@observer@*/ struct hostent *gethostbyaddr (/*@notnull@*/ const void *addr, size_t addrlen, int type)
1656 /*@requires maxRead(addr) == addrlen@*/ /*:i534 ??? is this right? */
1657 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostbyaddr_r instead"@*/
1658 /*@modifies h_errno@*/ ;
1660 struct hostent *gethostbyaddr_r (/*@notnull@*/ const void *addr, size_t addrlen, int type,
1661 /*@returned@*/ /*@out@*/ struct hostent *hent,
1662 /*@exposed@*/ /*@out@*/ char *buffer, int bufsize, /*@out@*/ int *h_errnop)
1663 /*@requires maxRead(addr) == addrlen /\ maxSet(buffer) >= bufsize@*/
1664 /*:i534 ??? is this right? */ ;
1666 /*@observer@*/ /*@null@*/ struct hostent *gethostent (void)
1667 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostent_r instead"@*/ ;
1669 struct hostent *gethostent_r (/*@out@*/ /*@returned@*/ struct hostent *hent, /*@exposed@*/ /*@out@*/ char *buffer, int bufsize)
1670 /*@requires maxSet(buffer) >= bufsize@*/ ;
1672 /*:i534 need to annotate these: */
1674 struct hostent *fgethostent(FILE *f);
1675 struct hostent *fgethostent_r(FILE*f, struct hostent *hent, char buffer, int bufsize);
1676 void sethostent(int stayopen);
1677 void endhostent(void);
1678 void herror(const char *string);
1679 char *hstrerror(int err);
1682 /*@observer@*/ /*@nullterminated@*/ char *h_name; /* official name of host */
1683 /*@observer@*/ /*@nullterminated@*/ char * /*:observer@*/ /*:nullterminated@*/ *h_aliases; /* alias list */
1684 int h_addrtype; /* host address type*/
1685 int h_length; /* length ofaddress*/
1686 /*@observer@*/ /*@nullterminated@*/ char * /*:observer@*/ /*:nullterminated@*/ *h_addr_list; /* list of addressesfrom name server */
1687 /*@observer@*/ /*@nullterminated@*/ char *h_addr; /* first address in list (backward compatibility) */
1694 int chroot (/*@notnull@*/ /*@nullterminated@*/ const char *path)
1696 /*@warn superuser "Only super-user processes may call chroot."@*/
1697 /*: other wanings? */ ;
1699 int fchroot (int fildes)
1701 /*@warn superuser "Only super-user processes may call fchroot."@*/ ;
1706 ** evans 2001-08-26 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/ctype.h.html
1710 lltX_bool isascii(int) /*@*/ ;
1711 lltX_bool toascii(int) /*@*/ ;
1712 char _toupper(/*@sef@*/ int) /*@*/ ;
1713 char _tolower(/*@sef@*/ int) /*@*/ ;
1715 lltX_bool /*@alt int@*/ isascii(int /*@alt unsigned char@*/) /*@*/ ;
1716 lltX_bool /*@alt int@*/ toascii(int /*@alt unsigned char@*/);
1717 char /*@alt int@*/ _toupper(/*@sef@*/ int /*@alt unsigned char@*/);
1718 char /*@alt int@*/ _tolower(/*@sef@*/ int /*@alt unsigned char@*/);
1721 /* other ctype.h functions in ansi.h */
1726 ** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/drand48.html
1729 double drand48 (void) /*@modifies internalState@*/ ;
1730 double erand48 (unsigned short int /*@-fixedformalarray@*/ xsubi[3] /*@=fixedformalarray@*/ )
1731 /*@modifies internalState@*/ ;
1733 void srand48 (long int seedval) /*@modifies internalState@*/ ;
1738 ** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xns/netinetin.h.html
1741 typedef /*@unsignedintegraltype@*/ in_port_t; /* An unsigned integral type of exactly 16 bits. */
1742 typedef /*@unsignedintegraltype@*/ in_addr_t; /* An unsigned integral type of exactly 32 bits. */
1744 typedef /*@unsignedintegraltype@*/ sa_family_t;
1750 struct sockaddr_in {
1751 sa_family_t sin_family;
1753 struct in_addr sin_addr;
1754 unsigned char sin_zero[8];
1758 /* The <netinet/in.h> header defines the following macros for use as values of the level argument of
1759 getsockopt() and setsockopt():
1762 /*@constant int IPPROTO_IP@*/
1763 /*@constant int IPPROTO_ICMP@*/
1764 /*@constant int IPPROTO_TCP@*/
1765 /*@constant int IPPROTO_UDP@*/
1767 /* The <netinet/in.h> header defines the following macros for use as destination addresses for connect(), sendmsg() and sendto():
1770 /*@constant in_addr_t INADDR_ANY@*/
1771 /*@constant in_addr_t INADDR_BROADCAST@*/
1777 in_addr_t htonl (in_addr_t hostlong) /*@*/ ;
1778 in_port_t htons (in_port_t hostshort) /*@*/ ;
1779 in_addr_t ntohl (in_addr_t netlong) /*@*/ ;
1780 in_port_t ntohs (in_port_t netshort) /*@*/ ;
1785 ** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/dirent.h.html
1788 /*@-redef@*/ /*@-matchfields@*/ /* Has d_ino field, not in posix (?) */
1796 /*@=redef@*/ /*@=matchfields@*/
1798 typedef /*@abstract@*/ DIR;
1800 /*:i32 need to check annotations on these */
1802 int closedir (DIR *) /*:errorcode -1*/ ;
1803 /*@null@*/ /*@dependent@*/ DIR *opendir(const char *) /*@modifies errno, fileSystem@*/ ;
1804 struct dirent *readdir(DIR *);
1805 int readdir_r(DIR *, struct dirent *, struct dirent **);
1806 void rewinddir(DIR *);
1807 void seekdir(DIR *, long int);
1808 long int telldir(DIR *);
1810 /*drl added these functions
1811 stpcpy and stpncpy are found on linux but
1812 don't seem to be present on other unixes
1814 thanks to Jeff Johnson for pointing out that
1815 these functions were in the unix library
1818 /* this function is like strcpy but it reutrns a pointer to the null terminated character in dest instead of the beginning of dest */
1820 extern char * stpcpy(/*@out@*/ /*@returned@*/ char * dest, const char * src)
1821 /*@modifies *dest @*/
1822 /*@requires maxSet(dest) >= maxRead(src) @*/
1823 /*@ensures MaxRead(dest) == MaxRead (src) /\ MaxRead(result) == 0 /\ MaxSet(result) == ( maxSet(dest) - MaxRead(src) ); @*/;
1826 extern char * stpncpy(/*@out@*/ /*@returned@*/ char * dest,
1827 const char * src, size_t n)
1828 /*@modifies *dest @*/
1829 /*@requires MaxSet(dest) >= ( n - 1 ); @*/ /*@ensures MaxRead (src) >= MaxRead(dest) /\ MaxRead (dest) <= n; @*/
1832 /* drl added 09-25-001
1833 Alexander Ma pointed out these were missing
1836 int usleep (useconds_t useconds) /*@modifies systemState, errno@*/
1837 /*error -1 sucess 0 */
1838 /* warn opengroup unix specification recommends using setitimer(), timer_create(), timer_delete(), timer_getoverrun(), timer_gettime() or
1839 timer_settime() instead of this interface.
1844 /* drl added 10-27-001 */
1845 /*not sure what the exact size of this is
1846 also can IPv6 use this function?
1848 /*I'm going to assume that the address had the format:
1849 "###.###.###.###" which is 16 bytes*/
1851 /*@kept@*/ char *inet_ntoa(struct in_addr in)
1852 /*@ensures maxSet(result) <= 15 /\ maxRead(result) <= 15 @*/
1856 extern double hypot(double x, double y) /*@modifies errno@*/ /*error errno only*/;
1859 extern double j0(double x) /*@modifies errno @*/ /*error 0 or NaN */;
1860 extern double j1(double x) /*@modifies errno @*/ /*error 0 or NaN */;
1861 extern double jn(int n, double x) /*@modifies errno @*/ /*error 0 or NaN */;
1863 extern double y0(double x) /*@modifies errno @*/ /*error NaN -HUGE_VAL 0.0 */ ;
1864 extern double y1 (double x) /*@modifies errno @*/ /*error NaN -HUGE_VAL 0.0 */;
1865 extern double yn (int n, double x) /*@modifies errno @*/ /*error NaN -HUGE_VAL 0.0 */;
1867 extern double acosh(double x) /*@modifies errno @*/ /*error errno and implementation-dependent(NaN if present) */ /*error NaN and may errno*/;
1868 extern double asinh(double x) /*@modifies errno @*/ /*error NaN and may errno */;
1870 extern double atanh(double x) /*@modifies errno @*/ /*error errno and implementation-dependent(NaN if present) */ /*error NaN and may errno */ ;
1872 extern double lgamma(double x) /*@modifies errno @*/ /*error NaN or HUGE_VAL may set errno */;
1874 extern int signgam ;
1876 extern double erf(double x) /*@modifies errno @*/ /*error NaN or 0 may set errno */;
1878 extern double erfc (double x) /*@modifies errno @*/ /*error NaN or 0