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 /*@constant long NGROUPS_MAX@*/
186 /*@constant long MAX_CANON@*/
187 /*@constant int MAX_CHAR@*/
188 /*@constant long OPEN_MAX@*/
189 /*@constant int PASS_MAX@*/
191 /*@constant int PID_MAX@*/
192 /*@constant int SYSPID_MAX@*/
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 ttyname_r (int fg, /*@out@*/ char *buffer, int len) /*@modifies buffer@*/ ;
289 int ioctl (int d, int /*@alt long@*/ request, /*@out@*/ void *arg)
290 /*@modifies *arg, errno@*/ ; /* depends on request! */
292 pid_t vfork (void) /*@modifies fileSystem@*/ ;
300 /*@constant int UIO_MAXIOV@*/ /* BSD */
301 /*@constant int IOV_MAX@*/ /* supposedly SVR4 */
304 readv (int fd, const struct iovec iov[], int iovcnt)
305 /*@modifies iov[].iov_base, fileSystem, errno@*/;
308 writev (int fd, const struct iovec iov[], int iovcnt)
309 /*@modifies errno@*/;
311 /*________________________________________________________________________
321 /*@constant short POLLIN@*/
322 /*@constant short POLLRDNORM@*/
323 /*@constant short POLLRDBAND@*/
324 /*@constant short POLLPRI@*/
325 /*@constant short POLLOUT@*/
326 /*@constant short POLLWRNORM@*/
327 /*@constant short POLLWRBAND@*/
328 /*@constant short POLLERR@*/
329 /*@constant short POLLHUP@*/
330 /*@constant short POLLNVAL@*/
332 extern int poll (struct poll pollfd[], unsigned long nfds, int timeout)
333 /*@modifies pollfd[].revents, errno@*/ ;
336 ** free does not take null
340 extern void free (/*@notnull@*/ /*@out@*/ /*@only@*/ void *p) /*@modifies *p@*/ ;
343 /*________________________________________________________________________
347 /*@constant int SOCK_STREAM@*/
348 /*@constant int SOCK_DGRAM@*/
349 /*@constant int SOCK_RAW@*/
350 /*@constant int SOCK_RDM@*/
351 /*@constant int SOCK_SEQPACKET@*/
352 /*@constant int SO_DEBUG@*/
353 /*@constant int SO_ACCEPTCONN@*/
354 /*@constant int SO_REUSEADDR@*/
355 /*@constant int SO_KEEPALIVE@*/
356 /*@constant int SO_DONTROUTE@*/
357 /*@constant int SO_BROADCAST@*/
358 /*@constant int SO_USELOOPBACK@*/
359 /*@constant int SO_LINGER@*/
360 /*@constant int SO_OOBINLINE@*/
361 /*@constant int SO_REUSEPORT@*/
362 /*@constant int SO_SNDBUF@*/
363 /*@constant int SO_RCVBUF@*/
364 /*@constant int SO_SNDLOWAT@*/
365 /*@constant int SO_RCVLOWAT@*/
366 /*@constant int SO_SNDTIMEO@*/
367 /*@constant int SO_RCVTIMEO@*/
368 /*@constant int SO_ERROR@*/
369 /*@constant int SO_TYPE@*/
370 /*@constant int SOL_SOCKET@*/
371 /*@constant int AF_UNSPEC@*/
372 /*@constant int AF_LOCAL@*/
373 /*@constant int AF_UNIX@*/
374 /*@constant int AF_INET@*/
375 /*@constant int AF_IMPLINK@*/
376 /*@constant int AF_PUP@*/
377 /*@constant int AF_CHAOS@*/
378 /*@constant int AF_NS@*/
379 /*@constant int AF_ISO@*/
380 /*@constant int AF_OSI@*/
381 /*@constant int AF_ECMA@*/
382 /*@constant int AF_DATAKIT@*/
383 /*@constant int AF_CCITT@*/
384 /*@constant int AF_SNA@*/
385 /*@constant int AF_DECnet@*/
386 /*@constant int AF_DLI@*/
387 /*@constant int AF_LAT@*/
388 /*@constant int AF_HYLINK@*/
389 /*@constant int AF_APPLETALK@*/
390 /*@constant int AF_ROUTE@*/
391 /*@constant int AF_LINK@*/
392 /*@constant int pseudo_AF_XTP@*/
393 /*@constant int AF_COIP@*/
394 /*@constant int AF_CNT@*/
395 /*@constant int pseudo_AF_RTIP@*/
396 /*@constant int AF_IPX@*/
397 /*@constant int AF_SIP@*/
398 /*@constant int pseudo_AF_PIP@*/
399 /*@constant int AF_ISDN@*/
400 /*@constant int AF_E164@*/
401 /*@constant int AF_MAX@*/
402 /*@constant int MSG_OOB@*/
403 /*@constant int MSG_PEEK@*/
404 /*@constant int MSG_DONTROUTE@*/
405 /*@constant int MSG_EOR@*/
406 /*@constant int MSG_TRUNC@*/
407 /*@constant int MSG_CTRUNC@*/
408 /*@constant int MSG_WAITALL@*/
409 /*@constant int MSG_DONTWAIT@*/
410 /*@constant int MSG_EOF@*/
411 /*@constant int MSG_COMPAT@*/
412 /*@constant int PF_UNSPEC@*/
413 /*@constant int PF_LOCAL@*/
414 /*@constant int PF_UNIX@*/
415 /*@constant int PF_INET@*/
416 /*@constant int PF_IMPLINK@*/
417 /*@constant int PF_PUP@*/
418 /*@constant int PF_CHAOS@*/
419 /*@constant int PF_NS@*/
420 /*@constant int PF_ISO@*/
421 /*@constant int PF_OSI@*/
422 /*@constant int PF_ECMA@*/
423 /*@constant int PF_DATAKIT@*/
424 /*@constant int PF_CCITT@*/
425 /*@constant int PF_SNA@*/
426 /*@constant int PF_DECnet@*/
427 /*@constant int PF_DLI@*/
428 /*@constant int PF_LAT@*/
429 /*@constant int PF_HYLINK@*/
430 /*@constant int PF_APPLETALK@*/
431 /*@constant int PF_ROUTE@*/
432 /*@constant int PF_LINK@*/
433 /*@constant int PF_XTP@*/
434 /*@constant int PF_COIP@*/
435 /*@constant int PF_CNT@*/
436 /*@constant int PF_SIP@*/
437 /*@constant int PF_IPX@*/
438 /*@constant int PF_RTIP@*/
439 /*@constant int PF_PIP@*/
440 /*@constant int PF_ISDN@*/
441 /*@constant int PF_MAX@*/
442 /*@constant int NET_MAXID@*/
443 /*@constant int NET_RT_DUMP@*/
444 /*@constant int NET_RT_FLAGS@*/
445 /*@constant int NET_RT_IFLIST@*/
446 /*@constant int NET_RT_MAXID@*/
447 /*@constant int SOMAXCONN@*/
448 /*@constant int SCM_RIGHTS@*/
451 u_char sa_len; /* total length */
452 u_char sa_family; /* address family */
453 char sa_data[14]; /* actually longer; address value */
457 int l_onoff; /* option on/off */
458 int l_linger; /* linger time */
462 u_short sp_family; /* address family */
463 u_short sp_protocol; /* protocol */
466 caddr_t msg_name; /* optional address */
467 u_int msg_namelen; /* size of address */
468 struct iovec *msg_iov; /* scatter/gather array */
469 u_int msg_iovlen; /* # elements in msg_iov */
470 caddr_t msg_control; /* ancillary data, see below */
471 u_int msg_controllen; /* ancillary data buffer len */
472 int msg_flags; /* flags on received message */
476 u_int cmsg_len; /* data byte count, including hdr */
477 int cmsg_level; /* originating protocol */
478 int cmsg_type; /* protocol-specific type */
479 /* followed by u_char cmsg_data[]; */
483 accept (int s, struct sockaddr *addr, int *addrlen)
484 /*@modifies *addrlen, errno@*/;
487 bind (int s, struct sockaddr *name, int namelen)
488 /*@modifies errno, fileSystem@*/;
491 connect (int s, struct sockaddr *name, int namelen)
492 /*@modifies errno, internalState@*/;
494 int getpeername (int s, /*@out@*/ struct sockaddr *name, size_t *namelen)
495 /*@modifies *name, *namelen, errno@*/;
497 int getsockname (int s, struct sockaddr *address, size_t *address_len)
498 /*: can't do this? requires maxSet(address) >= (*address_len) @*/
499 /*@modifies *address, *address_len, errno@*/;
501 int getsockopt (int s, int level, int optname, /*@out@*/ void *optval, size_t *optlen)
502 /*@modifies *optval, *optlen, errno@*/;
505 listen (int s, int backlog)
506 /*@modifies errno, internalState@*/;
509 recv (int s, /*@out@*/ void *buf, size_t len, int flags)
510 /*@modifies *buf, errno@*/;
513 recvfrom (int s, void *buf, size_t len, int flags, /*@null@*/ struct sockaddr *from, int *fromlen)
514 /*@modifies *buf, *from, *fromlen, errno@*/;
517 recvmsg (int s, struct msghdr *msg, int flags)
518 /*@modifies msg->msg_iov->iov_base[], errno@*/;
521 send (int s, const void *msg, size_t len, int flags)
522 /*@modifies errno@*/;
525 sendto (int s, const void *msg, size_t len, int flags, const struct sockaddr *to, int tolen)
526 /*@modifies errno@*/;
529 sendmsg (int s, const struct msghdr *msg, int flags)
530 /*@modifies errno@*/;
533 setsockopt (int s, int level, int optname, const void *optval, int optlen)
534 /*@modifies internalState, errno@*/;
537 shutdown (int s, int how)
538 /*@modifies errno@*/;
541 socket (int domain, int type, int protocol)
542 /*@modifies errno@*/;
545 socketpair (int d, int type, int protocol, /*@out@*/ int *sv)
546 /*@modifies errno@*/;
548 /*@constant int BADSIG@*/
549 /*@constant int SA_ONSTACK@*/
550 /*@constant int SA_RESTART@*/
551 /*@constant int SA_DISABLE@*/
552 /*@constant int SIGBUS@*/
553 /*@constant int SIGEMT@*/
554 /*@constant int SIGINFO@*/
555 /*@constant int SIGIO@*/
556 /*@constant int SIGIOT@*/
557 /*@constant int SIGPOLL@*/
558 /*@constant int SIGPROF@*/
559 /*@constant int SIGPWR@*/
560 /*@constant int SIGSYS@*/
561 /*@constant int SIGTRAP@*/
562 /*@constant int SIGURG@*/
563 /*@constant int SIGVTALRM@*/
564 /*@constant int SIGWINCH@*/
565 /*@constant int SIGXCPU@*/
566 /*@constant int SIGXFSZ@*/
568 extern void psignal (int sig, const char *msg)
569 /*@modifies fileSystem@*/;
572 setenv (const char *name, const char *value, int overwrite)
573 /*@globals environ@*/
574 /*@modifies *environ, errno@*/;
577 unsetenv (const char *name)
578 /*@globals environ@*/
579 /*@modifies *environ@*/;
581 /*________________________________________________________________________
590 W_EXITCODE (int ret, int sig)
597 /*@constant int WAIT_ANY@*/
598 /*@constant int WAIT_MYPGRP@*/
599 /*@constant int WSTOPPED@*/
602 wait3 (int *statloc, int options, /*@null@*/ /*@out@*/ struct rusage *rusage)
603 /*@modifies *statloc, *rusage, errno@*/;
606 wait4 (pid_t p, int *statloc, int opt, /*@null@*/ /*@out@*/ struct rusage *r)
607 /*@modifies *statloc, *r, errno@*/;
624 /*@constant int DST_NONE@*/
625 /*@constant int DST_USA@*/
626 /*@constant int DST_AUST@*/
627 /*@constant int DST_WET@*/
628 /*@constant int DST_MET@*/
629 /*@constant int DST_EET@*/
630 /*@constant int DST_CAN@*/
632 /*@constant int ITIMER_PROF@*/
633 /*@constant int ITIMER_REAL@*/
634 /*@constant int ITIMER_VIRTUAL@*/
637 struct timeval it_interval;
638 struct timeval it_value;
649 adjtime (const struct timeval *delta, /*@null@*/ /*@out@*/ struct timeval *olddelta)
650 /*@modifies internalState, *olddelta, errno@*/;
653 getitimer (int which, /*@out@*/ struct itimerval *value)
654 /*@modifies errno, *value*/;
657 gettimeofday (/*@null@*/ /*@out@*/ struct timeval *tp, /*@null@*/ /*@out@*/ struct timezone *tzp)
658 /*@modifies *tp, *tzp, errno@*/;
661 setitimer (int which, struct itimerval *val, /*@null@*/ /*@out@*/ struct itimerval *oval)
662 /*@modifies *oval, errno, internalState*/;
665 settimeofday (const struct timeval *t, const struct timezone *z)
666 /*@modifies internalState, errno@*/;
669 utimes (const char *file, /*@null@*/ const struct timeval *times)
670 /*@modifies fileSystem, errno*/;
672 /*________________________________________________________________________
676 /*@constant int PROT_READ@*/
677 /*@constant int PROT_WRITE@*/
678 /*@constant int PROT_EXEC@*/
679 /*@constant int MAP_SHARED@*/
680 /*@constant int MAP_PRIVATE@*/
681 /*@constant int MAP_COPY@*/
682 /*@constant int MAP_FIXED@*/
683 /*@constant int MAP_RENAME@*/
684 /*@constant int MAP_NORESERVE@*/
685 /*@constant int MAP_INHERIT@*/
686 /*@constant int MAP_NOEXTEND@*/
687 /*@constant int MAP_HASSEMAPHORE@*/
688 /*@constant int MS_ASYNC@*/
689 /*@constant int MS_INVALIDATE@*/
690 /*@constant int MAP_FILE@*/
691 /*@constant int MAP_ANON@*/
692 /*@constant int MADV_NORMAL@*/
693 /*@constant int MADV_RANDOM@*/
694 /*@constant int MADV_SEQUENTIAL@*/
695 /*@constant int MADV_WILLNEED@*/
696 /*@constant int MADV_DONTNEED@*/
699 mmap (/*@null@*/ /*@returned@*/ caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
703 madvise (caddr_t addr, int len, int behav)
707 mprotect (caddr_t addr, int len, int prot)
711 int munmap (/*@only@*/ caddr_t addr, size_t len)
712 /*@modifies fileSystem, *addr, errno @*/;
715 msync (caddr_t addr, int len, int flags)
719 mlock (caddr_t addr, size_t len)
723 munlock (caddr_t addr, size_t len)
727 /*________________________________________________________________________
732 unsigned short ws_row;
733 unsigned short ws_col;
734 unsigned short ws_xpixel;
735 unsigned short ws_ypixel;
738 /*@constant int TIOCMODG@*/
739 /*@constant int TIOCMODS@*/
740 /*@constant int TIOCM_LE@*/
741 /*@constant int TIOCM_DTR@*/
742 /*@constant int TIOCM_RTS@*/
743 /*@constant int TIOCM_ST@*/
744 /*@constant int TIOCM_SR@*/
745 /*@constant int TIOCM_CTS@*/
746 /*@constant int TIOCM_CAR@*/
747 /*@constant int TIOCM_CD@*/
748 /*@constant int TIOCM_RNG@*/
749 /*@constant int TIOCM_RI@*/
750 /*@constant int TIOCM_DSR@*/
751 /*@constant int TIOCEXCL@*/
752 /*@constant int TIOCNXCL@*/
753 /*@constant int TIOCFLUSH@*/
754 /*@constant int TIOCGETA@*/
755 /*@constant int TIOCSETA@*/
756 /*@constant int TIOCSETAW@*/
757 /*@constant int TIOCSETAF@*/
758 /*@constant int TIOCGETD@*/
759 /*@constant int TIOCSETD@*/
760 /*@constant int TIOCSBRK@*/
761 /*@constant int TIOCCBRK@*/
762 /*@constant int TIOCSDTR@*/
763 /*@constant int TIOCCDTR@*/
764 /*@constant int TIOCGPGRP@*/
765 /*@constant int TIOCSPGRP@*/
766 /*@constant int TIOCOUTQ@*/
767 /*@constant int TIOCSTI@*/
768 /*@constant int TIOCNOTTY@*/
769 /*@constant int TIOCPKT@*/
770 /*@constant int TIOCPKT_DATA@*/
771 /*@constant int TIOCPKT_FLUSHREAD@*/
772 /*@constant int TIOCPKT_FLUSHWRITE@*/
773 /*@constant int TIOCPKT_STOP@*/
774 /*@constant int TIOCPKT_START@*/
775 /*@constant int TIOCPKT_NOSTOP@*/
776 /*@constant int TIOCPKT_DOSTOP@*/
777 /*@constant int TIOCPKT_IOCTL@*/
778 /*@constant int TIOCSTOP@*/
779 /*@constant int TIOCSTART@*/
780 /*@constant int TIOCMSET@*/
781 /*@constant int TIOCMBIS@*/
782 /*@constant int TIOCMBIC@*/
783 /*@constant int TIOCMGET@*/
784 /*@constant int TIOCREMOTE@*/
785 /*@constant int TIOCGWINSZ@*/
786 /*@constant int TIOCSWINSZ@*/
787 /*@constant int TIOCUCNTL@*/
788 /*@constant int TIOCSTAT@*/
789 /*@constant int TIOCCONS@*/
790 /*@constant int TIOCSCTTY@*/
791 /*@constant int TIOCEXT@*/
792 /*@constant int TIOCSIG@*/
793 /*@constant int TIOCDRAIN@*/
794 /*@constant int TIOCMSDTRWAIT@*/
795 /*@constant int TIOCMGDTRWAIT@*/
796 /*@constant int TIOCTIMESTAMP@*/
797 /*@constant int TIOCSDRAINWAIT@*/
798 /*@constant int TIOCGDRAINWAIT@*/
799 /*@constant int TTYDISC@*/
800 /*@constant int TABLDISC@*/
801 /*@constant int SLIPDISC@*/
802 /*@constant int PPPDISC@*/
804 /*@constant int MAXHOSTNAMELEN@*/
807 FD_CLR (int n, fd_set *p)
811 FD_COPY (fd_set *f, /*@out@*/ fd_set *t)
814 extern int /*@alt lltX_bool@*/
815 FD_ISSET (int n, fd_set *p)
819 FD_SET (int n, fd_set *p)
823 FD_ZERO (fd_set /*@out@*/ *p)
828 /*@modifies internalState, errno@*/;
831 fchown (int fd, uid_t owner, gid_t group)
832 /*@modifies errno, fileSystem@*/;
836 /*@modifies errno, fileSystem@*/;
839 ftruncate (int fd, off_t length)
840 /*@modifies errno, fileSystem@*/;
842 int gethostname (/*@out@*/ char *address, size_t address_len)
844 /*@modifies address@*/ ;
846 int initgroups (const char *name, int basegid)
847 /*@modifies internalState@*/;
850 lchown (const char *path, uid_t owner, gid_t group)
851 /*@modifies errno, fileSystem@*/;
854 readlink (const char *path, /*@out@*/ char *buf, int size)
855 /*@modifies *buf, errno@*/
857 /*@requires maxSet(buf) >= (size - 1) @*/
858 /*@ensures result <= size @*/;
861 select (int mfd, fd_set /*@null@*/ *r, fd_set /*@null@*/ *w, fd_set /*@null@*/ *e, struct timeval *t)
862 /*@modifies *r, *w, *e, *t, errno@*/;
866 /*@modifies errno, internalState@*/;
870 /*@modifies errno, internalState@*/;
873 setgroups (int ngroups, const gid_t *gidset)
874 /*@modifies errno, internalState@*/;
877 setregid (gid_t rgid, gid_t egid)
878 /*@modifies errno, internalState@*/;
881 setreuid (gid_t ruid, gid_t euid)
882 /*@modifies errno, internalState@*/;
886 /*@modifies fileSystem@*/;
889 symlink (const char *path, const char *path2)
890 /*@modifies fileSystem@*/;
893 truncate (const char *name, off_t length)
894 /*@modifies errno, fileSystem@*/;
896 /*@constant int EBADRPC@*/
897 /*@constant int ERPCMISMATCH@*/
898 /*@constant int EPROGUNAVAIL@*/
899 /*@constant int EPROGMISMATCH@*/
900 /*@constant int EPROCUNAVAIL@*/
901 /*@constant int EFTYPE@*/
902 /*@constant int EAUTH@*/
903 /*@constant int ENEEDAUTH@*/
904 /*@constant int ELAST@*/
910 /*@unchecked@*/ extern char *TMAGIC;
911 /*@constant int TMAGLEN@*/
912 /*@unchecked@*/ extern char *TVERSION;
913 /*@constant int TVERSLEN@*/
915 /*@constant int REGTYPE@*/
916 /*@constant int AREGTYPE@*/
917 /*@constant int LNKTYPE@*/
918 /*@constant int SYMTYPE@*/
919 /*@constant int CHRTYPE@*/
920 /*@constant int BLKTYPE@*/
921 /*@constant int DIRTYPE@*/
922 /*@constant int FIFOTYPE@*/
923 /*@constant int CONTTYPE@*/
925 /*@constant int TSUID@*/
926 /*@constant int TSGID@*/
927 /*@constant int TSVTX@*/
929 /*@constant int TUREAD@*/
930 /*@constant int TUWRITE@*/
931 /*@constant int TUEXEC@*/
932 /*@constant int TGREAD@*/
933 /*@constant int TGWRITE@*/
934 /*@constant int TGEXEC@*/
935 /*@constant int TOREAD@*/
936 /*@constant int TOWRITE@*/
937 /*@constant int TOEXEC@*/
940 uid_t uid; /* user id */
941 gid_t gid; /* group id */
942 uid_t cuid; /* creator user id */
943 gid_t cgid; /* creator group id */
944 mode_t mode; /* r/w permission */
945 ulong seq; /* slot usage sequence number */
946 key_t key; /* user specified msg/sem/shm key */
949 /*@constant int IPC_R@*/
950 /*@constant int IPC_W@*/
951 /*@constant int IPC_M@*/
952 /*@constant int IPC_CREAT@*/
953 /*@constant int IPC_EXCL@*/
954 /*@constant int IPC_NOWAIT@*/
955 /*@constant key_t IPC_PRIVATE@*/
956 /*@constant int IPC_RMID@*/
957 /*@constant int IPC_SET@*/
958 /*@constant int IPC_STAT@*/
965 struct ipc_perm msg_perm; /* msg queue permission bits */
966 struct msg *msg_first; /* first message in the queue */
967 struct msg *msg_last; /* last message in the queue */
968 u_long msg_cbytes; /* number of bytes in use on the queue */
969 u_long msg_qnum; /* number of msgs in the queue */
970 u_long msg_qbytes; /* max # of bytes on the queue */
971 pid_t msg_lspid; /* pid of last msgsnd() */
972 pid_t msg_lrpid; /* pid of last msgrcv() */
973 time_t msg_stime; /* time of last msgsnd() */
974 time_t msg_rtime; /* time of last msgrcv() */
975 time_t msg_ctime; /* time of last msgctl() */
979 long mtype; /* message type (+ve integer) */
980 char mtext[]; /* message body */
983 /*@constant int MSG_NOERROR@*/
984 /*@constant int MSGMAX@*/
985 /*@constant int MSGMNB@*/
986 /*@constant int MSGMNI@*/
987 /*@constant int MSGTQL@*/
990 msgctl (int id , int cmd, /*@out@*/ struct msqid_ds *buf)
991 /*@modifies errno, *buf@*/;
994 msgget (key_t key, int flag)
995 /*@modifies errno@*/;
998 msgrcv (int id, /*@out@*/ void *ptr, size_t nbytes, long type, int flags)
999 /*@modifies errno, *ptr@*/;
1002 msgsnd (int id, const void *ptr, size_t nbytes, int flag)
1003 /*@modifies errno@*/;
1010 struct ipc_perm sem_perm;
1011 struct sem *sem_base;
1026 struct semid_ds *buf;
1036 /*@constant int SEM_A@*/
1037 /*@constant int SEMAEM@*/
1038 /*@constant int SEMMNI@*/
1039 /*@constant int SEMMNS@*/
1040 /*@constant int SEMMNU@*/
1041 /*@constant int SEMMSL@*/
1042 /*@constant int SEMOPN@*/
1043 /*@constant int SEM_R@*/
1044 /*@constant int SEMUME@*/
1045 /*@constant int SEM_UNDO@*/
1046 /*@constant int SEMVMX@*/
1047 /*@constant int GETVAL@*/
1048 /*@constant int SETVAL@*/
1049 /*@constant int GETPID@*/
1050 /*@constant int GETNCNT@*/
1051 /*@constant int GETZCNT@*/
1052 /*@constant int GETALL@*/
1053 /*@constant int SETALL@*/
1055 /*@constant int ERMID@*/
1058 semctl (int id, int semnum, int cmd, union semun arg)
1059 /*@modifies errno@*/;
1062 semget (key_t key, int nsems, int flag)
1063 /*@modifies errno@*/;
1066 semop (int id, struct sembuf *semoparray, size_t nops)
1067 /*@modifies errno@*/;
1074 struct ipc_perm shm_perm;
1086 /*@constant int SHMLBA@*/
1087 /*@constant int SHM_LOCK@*/
1088 /*@constant int SHMMAX@*/
1089 /*@constant int SHMMIN@*/
1090 /*@constant int SHMMNI@*/
1091 /*@constant int SHM_R@*/
1092 /*@constant int SHM_RDONLY@*/
1093 /*@constant int SHM_RND@*/
1094 /*@constant int SHMSEG@*/
1095 /*@constant int SHM_W@*/
1096 /*@constant int SHM_UNLOCK@*/
1098 void * shmat (int id, /*@null@*/ void *addr, int flag)
1099 /*@modifies errno@*/ ;
1101 extern int shmctl (int id, int cmd, /*@out@*/ struct shmid_ds *buf)
1102 /*@modifies errno, *buf@*/ ;
1104 extern int shmdt (void *addr)
1105 /*@modifies errno@*/ ;
1107 extern int shmget (key_t key, int size, int flag)
1108 /*@modifies errno@*/ ;
1112 ** this is in stdio.h!
1120 ** evans 2001-12-30: added from http://www.opengroup.org/onlinepubs/007908799/xsh/stdio.h.html
1123 /*@constant unsignedintegraltype BUFSIZ@*/
1124 /*@constant unsignedintegraltype FILENAME_MAX@*/
1125 /*@constant unsignedintegraltype FOPEN_MAX@*/
1126 /*@constant bool _IOFBF@*/
1127 /*@constant bool _IOLBF@*/
1128 /*@constant bool _IONBF@*/
1129 /*@constant unsignedintegraltype L_ctermid@*/
1130 /*@constant unsignedintegraltype L_cuserid@*/
1131 /*@constant unsignedintegraltype L_tmpnam@*/
1132 /*@constant unsignedintegraltype SEEK_CUR@*/
1133 /*@constant unsignedintegraltype SEEK_END@*/
1134 /*@constant unsignedintegraltype SEEK_SET@*/
1135 /*@constant unsignedintegraltype TMP_MAX@*/
1140 /*@constant observer char *P_tmpdir@*/
1142 /*@dependent@*/ char *ctermid (/*@returned@*/ /*@null@*/ char *) /*@*/ ;
1143 /* Result may be static pointer if parameter is NULL, otherwise is fresh. */
1145 char *cuserid (/*@null@*/ /*@returned@*/ char *)
1146 /*@warn legacy "cuserid is obsolete"@*/ /*@*/ ;
1148 /*@null@*/ FILE *fdopen (int, const char *)
1149 /*@modifies errno, fileSystem@*/ ;
1151 int fileno (/*@notnull@*/ FILE *)
1153 /*@modifies errno@*/ ;
1155 void flockfile (/*@notnull@*/ FILE *f)
1156 /*@modifies f, fileSystem@*/ ;
1158 int fseeko (FILE *stream, off_t offset, int whence)
1160 /*@modifies stream, errno@*/ ;
1162 off_t ftello(FILE *stream)
1163 /*:errorcode -1:*/ /*@modifies errno*/ ;
1165 int ftrylockfile(FILE *stream)
1167 /*@modifies stream, fileSystem, errno*/ ;
1169 void funlockfile (FILE *stream)
1170 /*@modifies stream, fileSystem*/ ;
1172 int getc_unlocked(FILE *stream)
1173 /*@warn multithreaded "getc_unlocked is a thread unsafe version of getc"@*/
1174 /*@modifies *stream, fileSystem, errno@*/ ;
1176 int getchar_unlocked (void)
1177 /*@warn multithreaded "getchar_unlocked is a thread unsafe version of getchar"@*/
1179 /*@modifies *stdin, fileSystem@*/ ;
1181 int getopt (int, char * const[], const char)
1184 int getw (FILE *stream)
1186 /*@modifies fileSystem, *stream, errno@*/ ;
1188 int pclose(FILE *stream)
1190 /*@modifies *stream, errno@*/ ;
1192 /*@null@*/ FILE *popen (const char *command, const char *mode)
1193 /*:errorcode NULL:*/
1194 /*@modifies fileSystem, errno@*/ ;
1196 int putc_unlocked (int, FILE *stream)
1197 /*@warn multithreaded "putc_unlocked is a thread unsafe version of putc"@*/
1199 /*@modifies fileSystem, *stream, errno@*/ ;
1201 int putchar_unlocked(int)
1202 /*@warn multithreaded "putchar_unlocked is a thread unsafe version of putchar"@*/
1204 /*@modifies fileSystem, *stdout, errno@*/ ;
1206 int putw(int, FILE *stream)
1208 /*@modifies fileSystem, *stdout, errno@*/ ;
1210 int remove (const char *)
1211 /*@modifies fileSystem@*/ ;
1213 int rename (const char *, const char *)
1214 /*@modifies fileSystem@*/ ;
1216 void rewind (FILE *stream)
1217 /*@modifies *stream@*/ ;
1219 void setbuf (FILE *stream, /*@null@*/ char *buf);
1220 int setvbuf(FILE *, char *, int, size_t);
1221 int snprintf(char *, size_t, const char *, ...);
1222 int sprintf(char *, const char *, ...);
1223 int sscanf(const char *, const char *, int ...);
1224 char *tempnam(const char *, const char *);
1225 FILE *tmpfile(void);
1226 char *tmpnam(char *);
1227 int ungetc(int, FILE *);
1228 int vfprintf(FILE *, const char *, va_list);
1229 int vprintf(const char *, va_list);
1230 int vsnprintf(char *, size_t, const char *, va_list);
1231 int vsprintf(char *, const char *, va_list);
1234 The following external variables are defined:
1237 extern char *optarg; )
1238 extern int opterr; )
1239 extern int optind; ) (LEGACY)
1240 extern int optopt; )
1248 /*@constant int LOG_EMERG@*/
1249 /*@constant int LOG_ALERT@*/
1250 /*@constant int LOG_CRIT@*/
1251 /*@constant int LOG_ERR@*/
1252 /*@constant int LOG_WARNING@*/
1253 /*@constant int LOG_NOTICE@*/
1254 /*@constant int LOG_INFO@*/
1255 /*@constant int LOG_DEBUG@*/
1257 /*@constant int LOG_KERN@*/
1258 /*@constant int LOG_USER@*/
1259 /*@constant int LOG_MAIL@*/
1260 /*@constant int LOG_DAEMON@*/
1261 /*@constant int LOG_AUTH@*/
1262 /*@constant int LOG_SYSLOG@*/
1263 /*@constant int LOG_LPR@*/
1264 /*@constant int LOG_NEWS@*/
1265 /*@constant int LOG_UUCP@*/
1266 /*@constant int LOG_CRON@*/
1267 /*@constant int LOG_AUTHPRIV@*/
1268 /*@constant int LOG_FTP@*/
1269 /*@constant int LOG_LOCAL0@*/
1270 /*@constant int LOG_LOCAL1@*/
1271 /*@constant int LOG_LOCAL2@*/
1272 /*@constant int LOG_LOCAL3@*/
1273 /*@constant int LOG_LOCAL4@*/
1274 /*@constant int LOG_LOCAL5@*/
1275 /*@constant int LOG_LOCAL6@*/
1276 /*@constant int LOG_LOCAL7@*/
1278 /*@constant int LOG_PID@*/
1279 /*@constant int LOG_CONS@*/
1280 /*@constant int LOG_ODELAY@*/
1281 /*@constant int LOG_NDELAY@*/
1282 /*@constant int LOG_NOWAIT@*/
1283 /*@constant int LOG_PERROR@*/
1295 /*@modifies fileSystem@*/;
1298 openlog (const char *ident, int logopt, int facility)
1299 /*@modifies fileSystem@*/;
1302 setlogmask (int maskpri)
1303 /*@modifies internalState@*/;
1305 extern void /*@printflike@*/
1306 syslog (int priority, const char *message, ...)
1307 /*@modifies fileSystem@*/;
1310 vsyslog (int priority, const char *message, va_list args)
1311 /*@modifies fileSystem@*/;
1313 /*________________________________________________________________________
1319 /*@modifies internalState@*/;
1321 extern /*@null@*/ struct passwd *
1323 /*@modifies internalState@*/;
1326 setpassent (int stayopen)
1327 /*@modifies internalState@*/;
1331 /*@modifies internalState@*/;
1333 /*________________________________________________________________________
1339 /*@modifies internalState@*/;
1341 extern /*@null@*/ struct group *
1343 /*@modifies internalState@*/;
1347 /*@modifies internalState@*/;
1350 setgrfile (const char *name)
1351 /*@modifies internalState@*/;
1354 setgroupent (int stayopen)
1355 /*@modifies internalState@*/;
1360 ** evans 2001-08-26 - updated from http://www.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html
1364 ** struct stat replaces POSIX version - more required fields in Unix
1367 /*@-redef@*/ /*@-matchfields@*/
1369 dev_t st_dev; /* ID of device containing file */
1370 ino_t st_ino; /* file serial number */
1371 mode_t st_mode; /* mode of file (see below) */
1372 nlink_t st_nlink; /* number of links to the file */
1373 uid_t st_uid; /* user ID of file */
1374 gid_t st_gid; /* group ID of file */
1375 dev_t st_rdev; /* device ID (if file is character or block special) */
1376 off_t st_size; /* file size in bytes (if file is a regular file) */
1377 time_t st_atime; /* time of last access */
1378 time_t st_mtime; /* time of last data modification */
1379 time_t st_ctime; /* time of last status change */
1380 blksize_t st_blksize; /* a filesystem-specific preferred I/O block size for
1381 this object. In some filesystem types, this may
1382 vary from file to file */
1383 blkcnt_t st_blocks; /* number of blocks allocated for this object */
1385 /*@=redef@*/ /*@=matchfields@*/
1387 /*@constant mode_t S_IFMT@*/
1388 /*@constant mode_t S_IFBLK@*/
1389 /*@constant mode_t S_IFCHR@*/
1390 /*@constant mode_t S_IFIFO@*/
1391 /*@constant mode_t S_IFREG@*/
1392 /*@constant mode_t S_IFDIR@*/
1393 /*@constant mode_t S_IFLNK@*/
1395 /*@constant mode_t S_IRWXU@*/
1396 /*@constant mode_t S_IRUSR@*/
1398 /*@-incondefs@*/ /*: probably wrong in posix.h? */
1399 /*@constant mode_t S_IWUSR@*/
1400 /*@constant mode_t S_IXUSR@*/
1401 /*@constant mode_t S_IRWXG@*/
1402 /*@constant mode_t S_IRGRP@*/
1403 /*@constant mode_t S_IWGRP@*/
1404 /*@constant mode_t S_IXGRP@*/
1405 /*@constant mode_t S_IRWXO@*/
1406 /*@constant mode_t S_IROTH@*/
1407 /*@constant mode_t S_IWOTH@*/
1408 /*@constant mode_t S_IXOTH@*/
1409 /*@constant mode_t S_ISUID@*/
1410 /*@constant mode_t S_ISGID@*/
1411 /*@constant mode_t S_ISVTX@*/
1416 /*These are the old definitions - they don't appear to be in the Single UNIX Specification */
1418 /*@constant int S_ISTXT@*/
1419 /*@constant int S_IREAD@*/
1420 /*@constant int S_IWRITE@*/
1421 /*@constant int S_IEXEC@*/
1422 /*@constant int S_IFMT@*/
1423 /*@constant int S_IFIFO@*/
1424 /*@constant int S_IFCHR@*/
1425 /*@constant int S_IFDIR@*/
1426 /*@constant int S_IFBLK@*/
1427 /*@constant int S_IFREG@*/
1428 /*@constant int S_IFLNK@*/
1429 /*@constant int S_IFSOCK@*/
1430 /*@constant int S_ISVTX@*/
1431 /*@constant int S_ISVTX@*/
1432 /*@constant int SF_SETTABLE@*/
1433 /*@constant int SF_ARCHIVED@*/
1434 /*@constant int ACCESSPERMS@*/
1435 /*@constant int ALLPERMS@*/
1436 /*@constant int DEFFILEMODE@*/
1437 /*@constant int S_BLKSIZE@*/
1438 /*@constant int SF_IMMUTABLE@*/
1439 /*@constant int SF_APPEND@*/
1440 /*@constant int UF_NODUMP@*/
1441 /*@constant int UF_IMMUTABLE@*/
1442 /*@constant int UF_APPEND@*/
1445 int /*@alt lltX_bool@*/ S_ISBLK (/*@sef@*/ mode_t m) /*@*/;
1446 int /*@alt lltX_bool@*/ S_ISCHR (/*@sef@*/ mode_t m) /*@*/;
1447 int /*@alt lltX_bool@*/ S_ISDIR (/*@sef@*/ mode_t m) /*@*/;
1448 int /*@alt lltX_bool@*/ S_ISFIFO (/*@sef@*/ mode_t m) /*@*/;
1449 int /*@alt lltX_bool@*/ S_ISREG (/*@sef@*/ mode_t m) /*@*/;
1450 int /*@alt lltX_bool@*/ S_ISLNK (/*@sef@*/ mode_t m) /*@*/;
1452 int /*@alt lltX_bool@*/ S_TYPEISMQ (/*@sef@*/ struct stat *buf) /*@*/ ;
1453 int /*@alt lltX_bool@*/ S_TYPEISSEM (/*@sef@*/ struct stat *buf) /*@*/ ;
1454 int /*@alt lltX_bool@*/ S_TYPEISSHM (/*@sef@*/ struct stat *buf) /*@*/ ;
1456 /* in POSIX: chmod, fstat, mkdir, mkfifo, stat, umask */
1458 int lstat(const char *, /*@out@*/ struct stat *)
1460 /*@modifies errno@*/ ;
1462 int mknod (const char *, mode_t, dev_t)
1463 /*@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."@*/
1465 /*@modifies errno@*/ ;
1467 int chflags (const char *path, u_long flags)
1468 /*@warn unixstandard "Not in Single UNIX Specification Version 2"@*/
1469 /*@modifies fileSystem, errno@*/;
1471 int fchflags (int fd, u_long flags)
1472 /*@warn unixstandard "Not in Single UNIX Specification Version 2"@*/
1473 /*@modifies fileSystem, errno@*/;
1475 /*________________________________________________________________________
1479 /*@constant int FMNAMESZ@*/
1480 /*@constant int MSG_BAND@*/
1481 /*@constant int MSG_HIPRI@*/
1482 /*@constant int RS_HIPRI@*/
1483 /*@constant int S_INPUT@*/
1484 /*@constant int S_RDNORM@*/
1485 /*@constant int S_RDBAND@*/
1486 /*@constant int S_BANDURG@*/
1487 /*@constant int S_HIPRI@*/
1488 /*@constant int S_OUTPUT@*/
1489 /*@constant int S_WRNORM@*/
1490 /*@constant int S_WRBAND@*/
1491 /*@constant int S_MSG@*/
1492 /*@constant int S_ERROR@*/
1493 /*@constant int S_HANGUP@*/
1507 struct str_mlist *sl_modlist;
1511 getmsg (int fd, /*@out@*/ struct strbuf *c, /*@out@*/ struct strbuf *d, int *f)
1512 /*@modifies *c, *d, errno@*/;
1515 getpmsg (int fd, /*@out@*/ struct strbuf *c, /*@out@*/ struct strbuf *d, int *b, int *f)
1516 /*@modifies *b, *c, *d, errno@*/;
1519 putmsg (int fd, const struct strbuf *c, const struct strbuf *d, int *f)
1520 /*@modifies internalState, errno@*/;
1522 extern int putpmsg (int fd, const struct strbuf *c, const struct strbuf *d, int b, int *f)
1523 /*@modifies internalState, errno@*/;
1525 /*________________________________________________________________________
1529 /*@constant int RLIMIT_CPU@*/
1530 /*@constant int RLIMIT_FSIZE@*/
1531 /*@constant int RLIMIT_DATA@*/
1532 /*@constant int RLIMIT_STACK@*/
1533 /*@constant int RLIMIT_CORE@*/
1534 /*@constant int RLIMIT_RSS@*/
1535 /*@constant int RLIMIT_MEMLOCK@*/
1536 /*@constant int RLIMIT_NPROC@*/
1537 /*@constant int RLIMIT_NOFILE@*/
1538 /*@constant int RLIM_NLIMITS@*/
1539 /*@constant int RLIM_INFINITY@*/
1540 /*@constant int PRIO_MIN@*/
1541 /*@constant int PRIO_MAX@*/
1542 /*@constant int PRIO_PROCESS@*/
1543 /*@constant int PRIO_PGRP@*/
1544 /*@constant int PRIO_USER@*/
1545 /*@constant int RUSAGE_SELF@*/
1546 /*@constant int RUSAGE_CHILDREN@*/
1549 struct timeval ru_utime; /* user time used */
1550 struct timeval ru_stime; /* system time used */
1551 long ru_maxrss; /* max resident set size */
1552 long ru_ixrss; /* integral shared memory size */
1553 long ru_idrss; /* integral unshared data " */
1554 long ru_isrss; /* integral unshared stack " */
1555 long ru_minflt; /* page reclaims */
1556 long ru_majflt; /* page faults */
1557 long ru_nswap; /* swaps */
1558 long ru_inblock; /* block input operations */
1559 long ru_oublock; /* block output operations */
1560 long ru_msgsnd; /* messages sent */
1561 long ru_msgrcv; /* messages received */
1562 long ru_nsignals; /* signals received */
1563 long ru_nvcsw; /* voluntary context switches */
1564 long ru_nivcsw; /* involuntary " */
1573 unsigned long ldavg[3];
1578 getpriority (int which, int who)
1579 /*@modifies errno@*/;
1582 getrlimit (int res, /*@out@*/ struct rlimit *rlp)
1583 /*@modifies *rlp, errno@*/;
1586 getrusage (int who, /*@out@*/ struct rusage *rusage)
1587 /*@modifies *rusage, errno@*/;
1590 setpriority (int which, int who, int prio)
1591 /*@modifies errno, internalState@*/;
1594 setrlimit (int resource, const struct rlimit *rlp)
1595 /*@modifies errno, internalState@*/;
1604 /*@observer@*/ char *s_name; /* Official service name. */
1605 /*@observer@*/ char **s_aliases; /* Alias list. */
1606 int s_port; /* Port number. */
1607 /*@observer@*/ char *s_proto; /* Protocol to use. */
1610 /*@observer@*/ /*@dependent@*/ /*@null@*/ struct servent *getservbyname (const char *name, /*@null@*/ const char *proto)
1611 /*@warn multithreaded "Unsafe in multithreaded applications, use getsrvbyname_r instead"@*/ ;
1613 struct servent *getservbyname_r (const char *name, /*@null@*/ const char *proto, /*@out@*/ /*@returned@*/ struct servent *result, /*@out@*/ char *buffer, int buflen)
1614 /*@requires maxSet (buffer) >= buflen@*/ ;
1617 /*@observer@*/ /*@dependent@*/ struct servent *getservbyport (int port, /*@null@*/ const char *proto)
1618 /*@warn multithreaded "Unsafe in multithreaded applications, use getservbyport_r instead"@*/ ;
1620 struct servent *getservbyport_r (int port, /*@null@*/ const char *proto, /*@out@*/ /*@returned@*/ struct servent *result, /*@out@*/ char *buffer, int buflen)
1621 /*@requires maxSet (buffer) >= buflen@*/ ;
1623 /*@null@*/ struct servent *getservent (void);
1625 /*@null@*/ struct servent *getservent_r (struct servent *result, char *buffer, int buflen);
1627 int setservent (int stayopen);
1628 int endservent (void);
1632 /*@null@*/ /*@observer@*/ struct hostent *gethostbyname (/*@nullterminated@*/ /*@notnull@*/ const char *name)
1633 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostbyname_r instead"@*/
1634 /*@modifies h_errno@*/ ;
1636 struct hostent *gethostbyname_r (/*@nullterminated@*/ const char *name, /*@notnull@*/ /*@returned@*/ struct hostent *hent, /*@out@*/ /*@exposed@*/ char *buffer, int bufsize, /*@out@*/ int *h_errnop)
1637 /*@requires maxSet(buffer) >= bufsize@*/ ;
1639 /*@null@*/ /*@observer@*/ struct hostent *gethostbyaddr (/*@notnull@*/ const void *addr, size_t addrlen, int type)
1640 /*@requires maxRead(addr) == addrlen@*/ /*:i534 ??? is this right? */
1641 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostbyaddr_r instead"@*/
1642 /*@modifies h_errno@*/ ;
1644 struct hostent *gethostbyaddr_r (/*@notnull@*/ const void *addr, size_t addrlen, int type,
1645 /*@returned@*/ /*@out@*/ struct hostent *hent,
1646 /*@exposed@*/ /*@out@*/ char *buffer, int bufsize, /*@out@*/ int *h_errnop)
1647 /*@requires maxRead(addr) == addrlen /\ maxSet(buffer) >= bufsize@*/
1648 /*:i534 ??? is this right? */ ;
1650 /*@observer@*/ /*@null@*/ struct hostent *gethostent (void)
1651 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostent_r instead"@*/ ;
1653 struct hostent *gethostent_r (/*@out@*/ /*@returned@*/ struct hostent *hent, /*@exposed@*/ /*@out@*/ char *buffer, int bufsize)
1654 /*@requires maxSet(buffer) >= bufsize@*/ ;
1656 /*:i534 need to annotate these: */
1658 struct hostent *fgethostent(FILE *f);
1659 struct hostent *fgethostent_r(FILE*f, struct hostent *hent, char buffer, int bufsize);
1660 void sethostent(int stayopen);
1661 void endhostent(void);
1662 void herror(const char *string);
1663 char *hstrerror(int err);
1666 /*@observer@*/ /*@nullterminated@*/ char *h_name; /* official name of host */
1667 /*@observer@*/ /*@nullterminated@*/ char * /*:observer@*/ /*:nullterminated@*/ *h_aliases; /* alias list */
1668 int h_addrtype; /* host address type*/
1669 int h_length; /* length ofaddress*/
1670 /*@observer@*/ /*@nullterminated@*/ char * /*:observer@*/ /*:nullterminated@*/ *h_addr_list; /* list of addressesfrom name server */
1671 /*@observer@*/ /*@nullterminated@*/ char *h_addr; /* first address in list (backward compatibility) */
1678 int chroot (/*@notnull@*/ /*@nullterminated@*/ const char *path)
1680 /*@warn superuser "Only super-user processes may call chroot."@*/
1681 /*: other wanings? */ ;
1683 int fchroot (int fildes)
1685 /*@warn superuser "Only super-user processes may call fchroot."@*/ ;
1690 ** evans 2001-08-26 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/ctype.h.html
1694 lltX_bool isascii(int) /*@*/ ;
1695 lltX_bool toascii(int) /*@*/ ;
1696 char _toupper(/*@sef@*/ int) /*@*/ ;
1697 char _tolower(/*@sef@*/ int) /*@*/ ;
1699 lltX_bool /*@alt int@*/ isascii(int /*@alt unsigned char@*/) /*@*/ ;
1700 lltX_bool /*@alt int@*/ toascii(int /*@alt unsigned char@*/);
1701 char /*@alt int@*/ _toupper(/*@sef@*/ int /*@alt unsigned char@*/);
1702 char /*@alt int@*/ _tolower(/*@sef@*/ int /*@alt unsigned char@*/);
1705 /* other ctype.h functions in ansi.h */
1710 ** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/drand48.html
1713 double drand48 (void) /*@modifies internalState@*/ ;
1714 double erand48 (unsigned short int /*@-fixedformalarray@*/ xsubi[3] /*@=fixedformalarray@*/ )
1715 /*@modifies internalState@*/ ;
1717 void srand48 (long int seedval) /*@modifies internalState@*/ ;
1722 ** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xns/netinetin.h.html
1725 typedef /*@unsignedintegraltype@*/ in_port_t; /* An unsigned integral type of exactly 16 bits. */
1726 typedef /*@unsignedintegraltype@*/ in_addr_t; /* An unsigned integral type of exactly 32 bits. */
1728 typedef /*@unsignedintegraltype@*/ sa_family_t;
1734 struct sockaddr_in {
1735 sa_family_t sin_family;
1737 struct in_addr sin_addr;
1738 unsigned char sin_zero[8];
1742 /* The <netinet/in.h> header defines the following macros for use as values of the level argument of
1743 getsockopt() and setsockopt():
1746 /*@constant int IPPROTO_IP@*/
1747 /*@constant int IPPROTO_ICMP@*/
1748 /*@constant int IPPROTO_TCP@*/
1749 /*@constant int IPPROTO_UDP@*/
1751 /* The <netinet/in.h> header defines the following macros for use as destination addresses for connect(), sendmsg() and sendto():
1754 /*@constant in_addr_t INADDR_ANY@*/
1755 /*@constant in_addr_t INADDR_BROADCAST@*/
1761 in_addr_t htonl (in_addr_t hostlong) /*@*/ ;
1762 in_port_t htons (in_port_t hostshort) /*@*/ ;
1763 in_addr_t ntohl (in_addr_t netlong) /*@*/ ;
1764 in_port_t ntohs (in_port_t netshort) /*@*/ ;
1769 ** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/dirent.h.html
1772 /*@-redef@*/ /*@-matchfields@*/ /* Has d_ino field, not in posix (?) */
1780 /*@=redef@*/ /*@=matchfields@*/
1782 typedef /*@abstract@*/ DIR;
1784 /*:i32 need to check annotations on these */
1786 int closedir (DIR *) /*:errorcode -1*/ ;
1787 /*@null@*/ DIR *opendir(const char *) ;
1788 struct dirent *readdir(DIR *);
1789 int readdir_r(DIR *, struct dirent *, struct dirent **);
1790 void rewinddir(DIR *);
1791 void seekdir(DIR *, long int);
1792 long int telldir(DIR *);
1794 /*drl added these functions
1795 stpcpy and stpncpy are found on linux but
1796 don't seem to be present on other unixes
1798 thanks to Jeff Johnson for pointing out that
1799 these functions were in the unix library
1802 /* this function is like strcpy but it reutrns a pointer to the null terminated character in dest instead of the beginning of dest */
1804 extern char * stpcpy(/*@out@*/ /*@returned@*/ char * dest, const char * src)
1805 /*@modifies *dest @*/
1806 /*@requires maxSet(dest) >= maxRead(src) @*/
1807 /*@ensures MaxRead(dest) == MaxRead (src) /\ MaxRead(result) == 0 /\ MaxSet(result) == ( maxSet(dest) - MaxRead(src) ); @*/;
1810 extern char * stpncpy(/*@out@*/ /*@returned@*/ char * dest,
1811 const char * src, size_t n)
1812 /*@modifies *dest @*/
1813 /*@requires MaxSet(dest) >= ( n - 1 ); @*/ /*@ensures MaxRead (src) >= MaxRead(dest) /\ MaxRead (dest) <= n; @*/
1816 /* drl added 09-25-001
1817 Alexander Ma pointed out these were missing
1820 int usleep (useconds_t useconds) /*@modifies systemState, errno@*/
1821 /*error -1 sucess 0 */
1822 /* warn opengroup unix specification recommends using setitimer(), timer_create(), timer_delete(), timer_getoverrun(), timer_gettime() or
1823 timer_settime() instead of this interface.
1828 /* drl added 10-27-001 */
1831 /*not sure what the exact size of this is
1832 also can IPv6 use this function?
1835 char *inet_ntoa(struct in_addr in)
1836 /*@ensures maxSet(result) <= 15 /\ maxRead(result) <= 15 @*/
1840 extern double hypot(double x, double y) /*@modifies errno@*/ /*error errno only*/;
1843 extern double j0(double x) /*@modifies errno @*/ /*error 0 or NaN */;
1844 extern double j1(double x) /*@modifies errno @*/ /*error 0 or NaN */;
1845 extern double jn(int n, double x) /*@modifies errno @*/ /*error 0 or NaN */;
1847 extern double y0(double x) /*@modifies errno @*/ /*error NaN -HUGE_VAL 0.0 */ ;
1848 extern double y1 (double x) /*@modifies errno @*/ /*error NaN -HUGE_VAL 0.0 */;
1849 extern double yn (int n, double x) /*@modifies errno @*/ /*error NaN -HUGE_VAL 0.0 */;
1851 extern double acosh(double x) /*@modifies errno @*/ /*error errno and implementation-dependent(NaN if present) */ /*error NaN and may errno*/;
1852 extern double asinh(double x) /*@modifies errno @*/ /*error NaN and may errno */;
1854 extern double atanh(double x) /*@modifies errno @*/ /*error errno and implementation-dependent(NaN if present) */ /*error NaN and may errno */ ;
1856 extern double lgamma(double x) /*@modifies errno @*/ /*error NaN or HUGE_VAL may set errno */;
1858 extern int signgam ;
1860 extern double erf(double x) /*@modifies errno @*/ /*error NaN or 0 may set errno */;
1862 extern double erfc (double x) /*@modifies errno @*/ /*error NaN or 0