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;
15 typedef /*@integraltype@*/ clock_t;
16 typedef /*@integraltype@*/ clockid_t;
17 typedef /*@integraltype@*/ dev_t;
18 typedef /*@unsignedintegraltype@*/ fsblkcnt_t;
19 typedef /*@unsignedintegraltype@*/ fsfilcnt_t;
20 typedef /*@integraltype@*/ gid_t;
21 typedef /*@integraltype@*/ id_t;
22 typedef /*@unsignedintegraltype@*/ ino_t;
23 typedef /*@integraltype@*/ key_t;
24 typedef /*@integraltype@*/ mode_t;
25 typedef /*@integraltype@*/ nlink_t;
26 typedef /*@integraltype@*/ off_t;
27 typedef /*@integraltype@*/ pid_t;
28 typedef /*@integraltype@*/ pthread_attr_t;
29 typedef /*@integraltype@*/ pthread_cond_t;
30 typedef /*@integraltype@*/ pthread_condattr_t;
31 typedef /*@integraltype@*/ pthread_key_t;
32 typedef /*@integraltype@*/ pthread_mutex_t;
33 typedef /*@integraltype@*/ pthread_mutexattr_t;
34 typedef /*@integraltype@*/ pthread_once_t;
35 typedef /*@integraltype@*/ pthread_rwlock_t;
36 typedef /*@integraltype@*/ pthread_rwlockattr_t;
37 typedef /*@integraltype@*/ pthread_t;
38 typedef /*@signedintegraltype@*/ suseconds_t;
39 typedef /*@integraltype@*/ time_t;
40 typedef /*@integraltype@*/ timer_t;
41 typedef /*@integraltype@*/ uid_t;
42 typedef /*@unsignedintegraltype@*/ useconds_t;
44 /*-------------------------------------------------------------
45 -------------------------------------------------------------
50 ** Extra stuff in some unixen, not in posix.
53 /*@unchecked@*/ int signgam;
55 typedef /*@integraltype@*/ clockid_t;
57 extern void bcopy (char *b1, /*@out@*/ char *b2, int length)
58 /*@modifies *b2@*/ ; /* Yes, the second parameter is the out param! */
60 extern int /*@alt lltX_bool@*/ bcmp (char *b1, char *b2, int length) /*@*/ ;
61 /* Return value is NOT like strcmp! */
63 extern void bzero (/*@out@*/ char *b1, int length) /*@modifies *b1@*/ ;
64 extern int ffs (int i) /*@*/ ;
65 extern int symlink (char *name1, char *name2) /*@modifies fileSystem@*/ ;
68 setvbuf_unlocked (FILE *stream, /*@null@*/ /*@exposed@*/ char *buf,
69 int mode, size_t size)
70 /*@modifies internalState@*/ ;
73 setbuffer (FILE *stream, /*@null@*/ /*@exposed@*/ char *buf, int size)
74 /*@modifies internalState@*/ ;
76 extern void setlinebuf (FILE *stream) /*@modifies internalState@*/ ;
78 extern int strerror_r (int errnum, /*@out@*/ char *strerrbuf, int buflen)
79 /*@modifies strerrbuf@*/ ;
82 fread_unlocked (/*@out@*/ void *ptr, size_t size, size_t nitems,
84 /*@modifies *stream, *ptr;@*/ ;
87 fwrite_unlocked (void *pointer, size_t size, size_t num_items, FILE *stream)
88 /*@modifies *stream;@*/ ;
90 extern void /*@alt void * @*/
91 memccpy (/*@returned@*/ /*@out@*/ void *s1,
92 /*@unique@*/ void *s2, int c, size_t n)
95 extern int strcasecmp (char *s1, char *s2) /*@*/ ;
96 extern int strncasecmp (char *s1, char *s2, int n) /*@*/ ;
97 extern /*@null@*/ /*@only@*/ char *strdup (char *s) /*@*/ ;
99 extern /*@null@*/ /*@dependent@*/ char *
100 index (/*@returned@*/ char *s, char c) /*@*/ ;
102 extern /*@null@*/ /*@dependent@*/ char *
103 rindex (/*@returned@*/ char *s, char c) /*@*/ ;
106 extern double cbrt (double x) /*@modifies errno@*/ ;
107 extern double rint (double x) /*@*/ ;
108 extern double trunc (double x) /*@*/ ;
110 /*@constant int ENOTBLK@*/
111 /*@constant int ETXTBSY@*/
112 /*@constant int EWOULDBLOCK@*/
113 /*@constant int EINPROGRESS@*/
114 /*@constant int EALREADY@*/
115 /*@constant int ENOTSOCK@*/
116 /*@constant int EDESTADDRREQ@*/
117 /*@constant int EMSGSIZE@*/
118 /*@constant int EPROTOTYPE@*/
119 /*@constant int ENOPROTOOPT@*/
120 /*@constant int EPROTONOSUPPORT@*/
121 /*@constant int ESOCKTNOSUPPORT@*/
122 /*@constant int EOPNOTSUPP@*/
123 /*@constant int EPFNOSUPPORT@*/
124 /*@constant int EAFNOSUPPORT@*/
125 /*@constant int EADDRINUSE@*/
126 /*@constant int EADDRNOTAVAIL@*/
127 /*@constant int ENETDOWN@*/
128 /*@constant int ENETUNREACH@*/
129 /*@constant int ENETRESET@*/
130 /*@constant int ECONNABORTED@*/
131 /*@constant int ECONNRESET@*/
132 /*@constant int ENOBUFS@*/
133 /*@constant int EISCONN@*/
134 /*@constant int ENOTCONN@*/
135 /*@constant int ESHUTDOWN@*/
136 /*@constant int ETOOMANYREFS@*/
137 /*@constant int ETIMEDOUT@*/
138 /*@constant int ECONNREFUSED@*/
139 /*@constant int ENAMETOOLONG@*/
140 /*@constant int EHOSTDOWN@*/
141 /*@constant int EHOSTUNREACH@*/
142 /*@constant int ENOTEMPTY@*/
143 /*@constant int EPROCLIM@*/
144 /*@constant int EUSERS@*/
145 /*@constant int EDQUOT@*/
146 /*@constant int ESTALE@*/
147 /*@constant int EREMOTE@*/
148 /*@constant int ENOMSG@*/
149 /*@constant int EIDRM@*/
150 /*@constant int EALIGN@*/
151 /*@constant int EDEADLK@*/
152 /*@constant int ENOLCK@*/
153 /*@constant int ENOSYS@*/
154 /*@constant int EACTIVE@*/
155 /*@constant int ENOACTIVE@*/
156 /*@constant int ENORESOURCES@*/
157 /*@constant int ENOSYSTEM@*/
158 /*@constant int ENODUST@*/
159 /*@constant int EDUPNOCONN@*/
160 /*@constant int EDUPNODISCONN@*/
161 /*@constant int EDUPNOTCNTD@*/
162 /*@constant int EDUPNOTIDLE@*/
163 /*@constant int EDUPNOTWAIT@*/
164 /*@constant int EDUPNOTRUN@*/
165 /*@constant int EDUPBADOPCODE@*/
166 /*@constant int EDUPINTRANSIT@*/
167 /*@constant int EDUPTOOMANYCPUS@*/
168 /*@constant int ELOOP@*/
170 /*@constant int LOCK_MAX@*/
171 /*@constant int FCHR_MAX@*/
172 /*@constant int USI_MAX@*/
173 /*@constant int WORD_BIT@*/
174 /*@constant int LONG_BIT@*/
175 /*@constant long NAME_MAX@*/
176 /*@constant long NGROUPS_MAX@*/
177 /*@constant long MAX_INPUT@*/
178 /*@constant long MAX_CANON@*/
179 /*@constant int MAX_CHAR@*/
180 /*@constant long OPEN_MAX@*/
181 /*@constant int PASS_MAX@*/
182 /*@constant int PATH_MAX@*/
183 /*@constant int PID_MAX@*/
184 /*@constant int SYSPID_MAX@*/
185 /*@constant long PIPE_BUF@*/
186 /*@constant int PIPE_MAX@*/
187 /*@constant int PROC_MAX@*/
188 /*@constant int STD_BLK@*/
189 /*@constant int SYS_NMLN@*/
190 /*@constant int SYS_OPEN@*/
191 /*@constant int NZERO@*/
192 /*@constant int UID_MAX@*/
193 /*@constant long MB_LEN_MAX@*/
194 /*@constant int NL_ARGMAX@*/
195 /*@constant int NL_MSGMAX@*/
196 /*@constant int NL_NMAX@*/
197 /*@constant int NL_SETMAX@*/
198 /*@constant int NL_TEXTMAX@*/
199 /*@constant int NL_LBLMAX@*/
200 /*@constant int NL_LANGMAX @*/
202 /*@constant double M_E@*/
203 /*@constant double M_LOG2E@*/
204 /*@constant double M_LOG10E@*/
205 /*@constant double M_LN2@*/
206 /*@constant double M_LN10@*/
207 /*@constant double M_PI@*/
208 /*@constant double M_PI_2@*/
209 /*@constant double M_PI_4@*/
210 /*@constant double M_1_PI@*/
211 /*@constant double M_2_PI@*/
212 /*@constant double M_2_SQRTPI@*/
213 /*@constant double M_SQRT2@*/
214 /*@constant double M_SQRT1_2@*/
216 /*@constant double MAXFLOAT@*/
217 /*@constant double HUGE@*/
219 /*@constant int DOMAIN@*/
220 /*@constant int SING@*/
221 /*@constant int OVERFLOW@*/
222 /*@constant int UNDERFLOW@*/
223 /*@constant int TLOSS@*/
224 /*@constant int PLOSS@*/
226 extern /*@unchecked@*/ int daylight;
227 extern /*@unchecked@*/ long timezone;
228 extern /*@unchecked@*/ char *tzname[];
231 extern void tzset(void) /*@modifies daylight, timezone, tzname@*/ ;
234 typedef unsigned char uchar_t;
235 typedef unsigned short ushort_t;
236 typedef unsigned int uint_t;
237 typedef unsigned long ulong_t;
238 typedef volatile unsigned char vuchar_t;
239 typedef volatile unsigned short vushort_t;
240 typedef volatile unsigned int vuint_t;
241 typedef volatile unsigned long vulong_t;
242 typedef long label_t;
244 typedef /*@integraltype@*/ daddr_t;
245 typedef char *caddr_t;
246 typedef long *qaddr_t;
247 typedef char *addr_t;
248 typedef long physadr_t;
251 typedef unsigned long rlim_t;
253 typedef /*@integraltype@*/ key_t;
255 typedef char slab_t[12];
256 typedef ulong_t shmatt_t;
257 typedef ulong_t msgqnum_t;
258 typedef ulong_t msglen_t;
259 typedef long timer_t;
260 typedef uchar_t uchar;
261 typedef ushort_t ushort;
263 typedef ulong_t ulong;
264 typedef uchar_t u_char;
265 typedef ushort_t u_short;
266 typedef uint_t u_int;
267 typedef ulong_t u_long;
268 typedef vuchar_t vu_char;
269 typedef vushort_t vu_short;
270 typedef vuint_t vu_int;
271 typedef vulong_t vu_long;
272 typedef long swblk_t;
273 typedef u_long fixpt_t;
274 typedef long segsz_t;
275 typedef /*@abstract@*/ fd_set;
277 int ttyname_r (int fg, /*@out@*/ char *buffer, int len) /*@modifies buffer@*/ ;
278 int ioctl (int d, int /*@alt long@*/ request, /*@out@*/ void *arg)
279 /*@modifies *arg, errno@*/ ; /* depends on request! */
281 pid_t vfork (void) /*@modifies fileSystem@*/ ;
289 /*@constant int UIO_MAXIOV@*/ /* BSD */
290 /*@constant int IOV_MAX@*/ /* supposedly SVR4 */
293 readv (int fd, const struct iovec iov[], int iovcnt)
294 /*@modifies iov[].iov_base, fileSystem, errno@*/;
297 writev (int fd, const struct iovec iov[], int iovcnt)
298 /*@modifies errno@*/;
300 /*________________________________________________________________________
310 /*@constant short POLLIN@*/
311 /*@constant short POLLRDNORM@*/
312 /*@constant short POLLRDBAND@*/
313 /*@constant short POLLPRI@*/
314 /*@constant short POLLOUT@*/
315 /*@constant short POLLWRNORM@*/
316 /*@constant short POLLWRBAND@*/
317 /*@constant short POLLERR@*/
318 /*@constant short POLLHUP@*/
319 /*@constant short POLLNVAL@*/
321 extern int poll (struct poll pollfd[], unsigned long nfds, int timeout)
322 /*@modifies pollfd[].revents, errno@*/ ;
325 ** free does not take null
329 extern void free (/*@notnull@*/ /*@out@*/ /*@only@*/ void *p) /*@modifies *p@*/ ;
332 /*________________________________________________________________________
336 /*@constant int SOCK_STREAM@*/
337 /*@constant int SOCK_DGRAM@*/
338 /*@constant int SOCK_RAW@*/
339 /*@constant int SOCK_RDM@*/
340 /*@constant int SOCK_SEQPACKET@*/
341 /*@constant int SO_DEBUG@*/
342 /*@constant int SO_ACCEPTCONN@*/
343 /*@constant int SO_REUSEADDR@*/
344 /*@constant int SO_KEEPALIVE@*/
345 /*@constant int SO_DONTROUTE@*/
346 /*@constant int SO_BROADCAST@*/
347 /*@constant int SO_USELOOPBACK@*/
348 /*@constant int SO_LINGER@*/
349 /*@constant int SO_OOBINLINE@*/
350 /*@constant int SO_REUSEPORT@*/
351 /*@constant int SO_SNDBUF@*/
352 /*@constant int SO_RCVBUF@*/
353 /*@constant int SO_SNDLOWAT@*/
354 /*@constant int SO_RCVLOWAT@*/
355 /*@constant int SO_SNDTIMEO@*/
356 /*@constant int SO_RCVTIMEO@*/
357 /*@constant int SO_ERROR@*/
358 /*@constant int SO_TYPE@*/
359 /*@constant int SOL_SOCKET@*/
360 /*@constant int AF_UNSPEC@*/
361 /*@constant int AF_LOCAL@*/
362 /*@constant int AF_UNIX@*/
363 /*@constant int AF_INET@*/
364 /*@constant int AF_IMPLINK@*/
365 /*@constant int AF_PUP@*/
366 /*@constant int AF_CHAOS@*/
367 /*@constant int AF_NS@*/
368 /*@constant int AF_ISO@*/
369 /*@constant int AF_OSI@*/
370 /*@constant int AF_ECMA@*/
371 /*@constant int AF_DATAKIT@*/
372 /*@constant int AF_CCITT@*/
373 /*@constant int AF_SNA@*/
374 /*@constant int AF_DECnet@*/
375 /*@constant int AF_DLI@*/
376 /*@constant int AF_LAT@*/
377 /*@constant int AF_HYLINK@*/
378 /*@constant int AF_APPLETALK@*/
379 /*@constant int AF_ROUTE@*/
380 /*@constant int AF_LINK@*/
381 /*@constant int pseudo_AF_XTP@*/
382 /*@constant int AF_COIP@*/
383 /*@constant int AF_CNT@*/
384 /*@constant int pseudo_AF_RTIP@*/
385 /*@constant int AF_IPX@*/
386 /*@constant int AF_SIP@*/
387 /*@constant int pseudo_AF_PIP@*/
388 /*@constant int AF_ISDN@*/
389 /*@constant int AF_E164@*/
390 /*@constant int AF_MAX@*/
391 /*@constant int MSG_OOB@*/
392 /*@constant int MSG_PEEK@*/
393 /*@constant int MSG_DONTROUTE@*/
394 /*@constant int MSG_EOR@*/
395 /*@constant int MSG_TRUNC@*/
396 /*@constant int MSG_CTRUNC@*/
397 /*@constant int MSG_WAITALL@*/
398 /*@constant int MSG_DONTWAIT@*/
399 /*@constant int MSG_EOF@*/
400 /*@constant int MSG_COMPAT@*/
401 /*@constant int PF_UNSPEC@*/
402 /*@constant int PF_LOCAL@*/
403 /*@constant int PF_UNIX@*/
404 /*@constant int PF_INET@*/
405 /*@constant int PF_IMPLINK@*/
406 /*@constant int PF_PUP@*/
407 /*@constant int PF_CHAOS@*/
408 /*@constant int PF_NS@*/
409 /*@constant int PF_ISO@*/
410 /*@constant int PF_OSI@*/
411 /*@constant int PF_ECMA@*/
412 /*@constant int PF_DATAKIT@*/
413 /*@constant int PF_CCITT@*/
414 /*@constant int PF_SNA@*/
415 /*@constant int PF_DECnet@*/
416 /*@constant int PF_DLI@*/
417 /*@constant int PF_LAT@*/
418 /*@constant int PF_HYLINK@*/
419 /*@constant int PF_APPLETALK@*/
420 /*@constant int PF_ROUTE@*/
421 /*@constant int PF_LINK@*/
422 /*@constant int PF_XTP@*/
423 /*@constant int PF_COIP@*/
424 /*@constant int PF_CNT@*/
425 /*@constant int PF_SIP@*/
426 /*@constant int PF_IPX@*/
427 /*@constant int PF_RTIP@*/
428 /*@constant int PF_PIP@*/
429 /*@constant int PF_ISDN@*/
430 /*@constant int PF_MAX@*/
431 /*@constant int NET_MAXID@*/
432 /*@constant int NET_RT_DUMP@*/
433 /*@constant int NET_RT_FLAGS@*/
434 /*@constant int NET_RT_IFLIST@*/
435 /*@constant int NET_RT_MAXID@*/
436 /*@constant int SOMAXCONN@*/
437 /*@constant int SCM_RIGHTS@*/
440 u_char sa_len; /* total length */
441 u_char sa_family; /* address family */
442 char sa_data[14]; /* actually longer; address value */
446 int l_onoff; /* option on/off */
447 int l_linger; /* linger time */
451 u_short sp_family; /* address family */
452 u_short sp_protocol; /* protocol */
455 caddr_t msg_name; /* optional address */
456 u_int msg_namelen; /* size of address */
457 struct iovec *msg_iov; /* scatter/gather array */
458 u_int msg_iovlen; /* # elements in msg_iov */
459 caddr_t msg_control; /* ancillary data, see below */
460 u_int msg_controllen; /* ancillary data buffer len */
461 int msg_flags; /* flags on received message */
465 u_int cmsg_len; /* data byte count, including hdr */
466 int cmsg_level; /* originating protocol */
467 int cmsg_type; /* protocol-specific type */
468 /* followed by u_char cmsg_data[]; */
472 accept (int s, struct sockaddr *addr, int *addrlen)
473 /*@modifies *addrlen, errno@*/;
476 bind (int s, struct sockaddr *name, int namelen)
477 /*@modifies errno, fileSystem@*/;
480 connect (int s, struct sockaddr *name, int namelen)
481 /*@modifies errno, internalState@*/;
483 int getpeername (int s, /*@out@*/ struct sockaddr *name, size_t *namelen)
484 /*@modifies *name, *namelen, errno@*/;
486 int getsockname (int s, struct sockaddr *address, size_t *address_len)
487 // /*@requires maxSet(address) >= ( *address_len) @*/
488 /*@modifies *address, *address_len, errno@*/;
490 int getsockopt (int s, int level, int optname, /*@out@*/ void *optval, size_t *optlen)
491 /*@modifies *optval, *optlen, errno@*/;
494 listen (int s, int backlog)
495 /*@modifies errno, internalState@*/;
498 recv (int s, /*@out@*/ void *buf, size_t len, int flags)
499 /*@modifies *buf, errno@*/;
502 recvfrom (int s, void *buf, size_t len, int flags, /*@null@*/ struct sockaddr *from, int *fromlen)
503 /*@modifies *buf, *from, *fromlen, errno@*/;
506 recvmsg (int s, struct msghdr *msg, int flags)
507 /*@modifies msg->msg_iov->iov_base[], errno@*/;
510 send (int s, const void *msg, size_t len, int flags)
511 /*@modifies errno@*/;
514 sendto (int s, const void *msg, size_t len, int flags, const struct sockaddr *to, int tolen)
515 /*@modifies errno@*/;
518 sendmsg (int s, const struct msghdr *msg, int flags)
519 /*@modifies errno@*/;
522 setsockopt (int s, int level, int optname, const void *optval, int optlen)
523 /*@modifies internalState, errno@*/;
526 shutdown (int s, int how)
527 /*@modifies errno@*/;
530 socket (int domain, int type, int protocol)
531 /*@modifies errno@*/;
534 socketpair (int d, int type, int protocol, /*@out@*/ int *sv)
535 /*@modifies errno@*/;
537 /*@constant int BADSIG@*/
538 /*@constant int SA_ONSTACK@*/
539 /*@constant int SA_RESTART@*/
540 /*@constant int SA_DISABLE@*/
541 /*@constant int SIGBUS@*/
542 /*@constant int SIGEMT@*/
543 /*@constant int SIGINFO@*/
544 /*@constant int SIGIO@*/
545 /*@constant int SIGIOT@*/
546 /*@constant int SIGPOLL@*/
547 /*@constant int SIGPROF@*/
548 /*@constant int SIGPWR@*/
549 /*@constant int SIGSYS@*/
550 /*@constant int SIGTRAP@*/
551 /*@constant int SIGURG@*/
552 /*@constant int SIGVTALRM@*/
553 /*@constant int SIGWINCH@*/
554 /*@constant int SIGXCPU@*/
555 /*@constant int SIGXFSZ@*/
557 extern void psignal (int sig, const char *msg)
558 /*@modifies fileSystem@*/;
561 setenv (const char *name, const char *value, int overwrite)
562 /*@globals environ@*/
563 /*@modifies *environ, errno@*/;
566 unsetenv (const char *name)
567 /*@globals environ@*/
568 /*@modifies *environ@*/;
570 /*________________________________________________________________________
579 W_EXITCODE (int ret, int sig)
586 /*@constant int WAIT_ANY@*/
587 /*@constant int WAIT_MYPGRP@*/
588 /*@constant int WSTOPPED@*/
591 wait3 (int *statloc, int options, /*@null@*/ /*@out@*/ struct rusage *rusage)
592 /*@modifies *statloc, *rusage, errno@*/;
595 wait4 (pid_t p, int *statloc, int opt, /*@null@*/ /*@out@*/ struct rusage *r)
596 /*@modifies *statloc, *r, errno@*/;
613 /*@constant int DST_NONE@*/
614 /*@constant int DST_USA@*/
615 /*@constant int DST_AUST@*/
616 /*@constant int DST_WET@*/
617 /*@constant int DST_MET@*/
618 /*@constant int DST_EET@*/
619 /*@constant int DST_CAN@*/
621 /*@constant int ITIMER_PROF@*/
622 /*@constant int ITIMER_REAL@*/
623 /*@constant int ITIMER_VIRTUAL@*/
626 struct timeval it_interval;
627 struct timeval it_value;
638 adjtime (const struct timeval *delta, /*@null@*/ /*@out@*/ struct timeval *olddelta)
639 /*@modifies internalState, *olddelta, errno@*/;
642 getitimer (int which, /*@out@*/ struct itimerval *value)
643 /*@modifies errno, *value*/;
646 gettimeofday (/*@null@*/ /*@out@*/ struct timeval *tp, /*@null@*/ /*@out@*/ struct timezone *tzp)
647 /*@modifies *tp, *tzp, errno@*/;
650 setitimer (int which, struct itimerval *val, /*@null@*/ /*@out@*/ struct itimerval *oval)
651 /*@modifies *oval, errno, internalState*/;
654 settimeofday (const struct timeval *t, const struct timezone *z)
655 /*@modifies internalState, errno@*/;
658 utimes (const char *file, /*@null@*/ const struct timeval *times)
659 /*@modifies fileSystem, errno*/;
661 /*________________________________________________________________________
665 /*@constant int PROT_READ@*/
666 /*@constant int PROT_WRITE@*/
667 /*@constant int PROT_EXEC@*/
668 /*@constant int MAP_SHARED@*/
669 /*@constant int MAP_PRIVATE@*/
670 /*@constant int MAP_COPY@*/
671 /*@constant int MAP_FIXED@*/
672 /*@constant int MAP_RENAME@*/
673 /*@constant int MAP_NORESERVE@*/
674 /*@constant int MAP_INHERIT@*/
675 /*@constant int MAP_NOEXTEND@*/
676 /*@constant int MAP_HASSEMAPHORE@*/
677 /*@constant int MS_ASYNC@*/
678 /*@constant int MS_INVALIDATE@*/
679 /*@constant int MAP_FILE@*/
680 /*@constant int MAP_ANON@*/
681 /*@constant int MADV_NORMAL@*/
682 /*@constant int MADV_RANDOM@*/
683 /*@constant int MADV_SEQUENTIAL@*/
684 /*@constant int MADV_WILLNEED@*/
685 /*@constant int MADV_DONTNEED@*/
688 mmap (/*@null@*/ /*@returned@*/ caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset)
692 madvise (caddr_t addr, int len, int behav)
696 mprotect (caddr_t addr, int len, int prot)
700 int munmap (/*@only@*/ caddr_t addr, size_t len)
701 /*@modifies fileSystem, *addr, errno @*/;
704 msync (caddr_t addr, int len, int flags)
708 mlock (caddr_t addr, size_t len)
712 munlock (caddr_t addr, size_t len)
716 /*________________________________________________________________________
721 unsigned short ws_row;
722 unsigned short ws_col;
723 unsigned short ws_xpixel;
724 unsigned short ws_ypixel;
727 /*@constant int TIOCMODG@*/
728 /*@constant int TIOCMODS@*/
729 /*@constant int TIOCM_LE@*/
730 /*@constant int TIOCM_DTR@*/
731 /*@constant int TIOCM_RTS@*/
732 /*@constant int TIOCM_ST@*/
733 /*@constant int TIOCM_SR@*/
734 /*@constant int TIOCM_CTS@*/
735 /*@constant int TIOCM_CAR@*/
736 /*@constant int TIOCM_CD@*/
737 /*@constant int TIOCM_RNG@*/
738 /*@constant int TIOCM_RI@*/
739 /*@constant int TIOCM_DSR@*/
740 /*@constant int TIOCEXCL@*/
741 /*@constant int TIOCNXCL@*/
742 /*@constant int TIOCFLUSH@*/
743 /*@constant int TIOCGETA@*/
744 /*@constant int TIOCSETA@*/
745 /*@constant int TIOCSETAW@*/
746 /*@constant int TIOCSETAF@*/
747 /*@constant int TIOCGETD@*/
748 /*@constant int TIOCSETD@*/
749 /*@constant int TIOCSBRK@*/
750 /*@constant int TIOCCBRK@*/
751 /*@constant int TIOCSDTR@*/
752 /*@constant int TIOCCDTR@*/
753 /*@constant int TIOCGPGRP@*/
754 /*@constant int TIOCSPGRP@*/
755 /*@constant int TIOCOUTQ@*/
756 /*@constant int TIOCSTI@*/
757 /*@constant int TIOCNOTTY@*/
758 /*@constant int TIOCPKT@*/
759 /*@constant int TIOCPKT_DATA@*/
760 /*@constant int TIOCPKT_FLUSHREAD@*/
761 /*@constant int TIOCPKT_FLUSHWRITE@*/
762 /*@constant int TIOCPKT_STOP@*/
763 /*@constant int TIOCPKT_START@*/
764 /*@constant int TIOCPKT_NOSTOP@*/
765 /*@constant int TIOCPKT_DOSTOP@*/
766 /*@constant int TIOCPKT_IOCTL@*/
767 /*@constant int TIOCSTOP@*/
768 /*@constant int TIOCSTART@*/
769 /*@constant int TIOCMSET@*/
770 /*@constant int TIOCMBIS@*/
771 /*@constant int TIOCMBIC@*/
772 /*@constant int TIOCMGET@*/
773 /*@constant int TIOCREMOTE@*/
774 /*@constant int TIOCGWINSZ@*/
775 /*@constant int TIOCSWINSZ@*/
776 /*@constant int TIOCUCNTL@*/
777 /*@constant int TIOCSTAT@*/
778 /*@constant int TIOCCONS@*/
779 /*@constant int TIOCSCTTY@*/
780 /*@constant int TIOCEXT@*/
781 /*@constant int TIOCSIG@*/
782 /*@constant int TIOCDRAIN@*/
783 /*@constant int TIOCMSDTRWAIT@*/
784 /*@constant int TIOCMGDTRWAIT@*/
785 /*@constant int TIOCTIMESTAMP@*/
786 /*@constant int TIOCSDRAINWAIT@*/
787 /*@constant int TIOCGDRAINWAIT@*/
788 /*@constant int TTYDISC@*/
789 /*@constant int TABLDISC@*/
790 /*@constant int SLIPDISC@*/
791 /*@constant int PPPDISC@*/
793 /*@constant int MAXHOSTNAMELEN@*/
796 FD_CLR (int n, fd_set *p)
800 FD_COPY (fd_set *f, /*@out@*/ fd_set *t)
803 extern int /*@alt lltX_bool@*/
804 FD_ISSET (int n, fd_set *p)
808 FD_SET (int n, fd_set *p)
812 FD_ZERO (fd_set /*@out@*/ *p)
817 /*@modifies internalState, errno@*/;
820 fchown (int fd, uid_t owner, gid_t group)
821 /*@modifies errno, fileSystem@*/;
825 /*@modifies errno, fileSystem@*/;
828 ftruncate (int fd, off_t length)
829 /*@modifies errno, fileSystem@*/;
831 int gethostname (/*@out@*/ char *address, size_t address_len)
833 /*@modifies address@*/ ;
835 int initgroups (const char *name, int basegid)
836 /*@modifies internalState@*/;
839 lchown (const char *path, uid_t owner, gid_t group)
840 /*@modifies errno, fileSystem@*/;
843 readlink (const char *path, /*@out@*/ char *buf, int size)
844 /*@modifies *buf, errno@*/ /*@ensures result <= size @*/;
847 select (int mfd, fd_set /*@null@*/ *r, fd_set /*@null@*/ *w, fd_set /*@null@*/ *e, struct timeval *t)
848 /*@modifies *r, *w, *e, *t, errno@*/;
852 /*@modifies errno, internalState@*/;
856 /*@modifies errno, internalState@*/;
859 setgroups (int ngroups, const gid_t *gidset)
860 /*@modifies errno, internalState@*/;
863 setregid (gid_t rgid, gid_t egid)
864 /*@modifies errno, internalState@*/;
867 setreuid (gid_t ruid, gid_t euid)
868 /*@modifies errno, internalState@*/;
872 /*@modifies fileSystem@*/;
875 symlink (const char *path, const char *path2)
876 /*@modifies fileSystem@*/;
879 truncate (const char *name, off_t length)
880 /*@modifies errno, fileSystem@*/;
882 /*@constant int EBADRPC@*/
883 /*@constant int ERPCMISMATCH@*/
884 /*@constant int EPROGUNAVAIL@*/
885 /*@constant int EPROGMISMATCH@*/
886 /*@constant int EPROCUNAVAIL@*/
887 /*@constant int EFTYPE@*/
888 /*@constant int EAUTH@*/
889 /*@constant int ENEEDAUTH@*/
890 /*@constant int ELAST@*/
892 /*________________________________________________________________________
896 /*@unchecked@*/ extern char *TMAGIC;
897 /*@constant int TMAGLEN@*/
898 /*@unchecked@*/ extern char *TVERSION;
899 /*@constant int TVERSLEN@*/
901 /*@constant int REGTYPE@*/
902 /*@constant int AREGTYPE@*/
903 /*@constant int LNKTYPE@*/
904 /*@constant int SYMTYPE@*/
905 /*@constant int CHRTYPE@*/
906 /*@constant int BLKTYPE@*/
907 /*@constant int DIRTYPE@*/
908 /*@constant int FIFOTYPE@*/
909 /*@constant int CONTTYPE@*/
911 /*@constant int TSUID@*/
912 /*@constant int TSGID@*/
913 /*@constant int TSVTX@*/
915 /*@constant int TUREAD@*/
916 /*@constant int TUWRITE@*/
917 /*@constant int TUEXEC@*/
918 /*@constant int TGREAD@*/
919 /*@constant int TGWRITE@*/
920 /*@constant int TGEXEC@*/
921 /*@constant int TOREAD@*/
922 /*@constant int TOWRITE@*/
923 /*@constant int TOEXEC@*/
926 uid_t uid; /* user id */
927 gid_t gid; /* group id */
928 uid_t cuid; /* creator user id */
929 gid_t cgid; /* creator group id */
930 mode_t mode; /* r/w permission */
931 ulong seq; /* slot usage sequence number */
932 key_t key; /* user specified msg/sem/shm key */
935 /*@constant int IPC_R@*/
936 /*@constant int IPC_W@*/
937 /*@constant int IPC_M@*/
938 /*@constant int IPC_CREAT@*/
939 /*@constant int IPC_EXCL@*/
940 /*@constant int IPC_NOWAIT@*/
941 /*@constant key_t IPC_PRIVATE@*/
942 /*@constant int IPC_RMID@*/
943 /*@constant int IPC_SET@*/
944 /*@constant int IPC_STAT@*/
946 /*________________________________________________________________________
951 struct ipc_perm msg_perm; /* msg queue permission bits */
952 struct msg *msg_first; /* first message in the queue */
953 struct msg *msg_last; /* last message in the queue */
954 u_long msg_cbytes; /* number of bytes in use on the queue */
955 u_long msg_qnum; /* number of msgs in the queue */
956 u_long msg_qbytes; /* max # of bytes on the queue */
957 pid_t msg_lspid; /* pid of last msgsnd() */
958 pid_t msg_lrpid; /* pid of last msgrcv() */
959 time_t msg_stime; /* time of last msgsnd() */
960 time_t msg_rtime; /* time of last msgrcv() */
961 time_t msg_ctime; /* time of last msgctl() */
965 long mtype; /* message type (+ve integer) */
966 char mtext[]; /* message body */
969 /*@constant int MSG_NOERROR@*/
970 /*@constant int MSGMAX@*/
971 /*@constant int MSGMNB@*/
972 /*@constant int MSGMNI@*/
973 /*@constant int MSGTQL@*/
976 msgctl (int id , int cmd, /*@out@*/ struct msqid_ds *buf)
977 /*@modifies errno, *buf@*/;
980 msgget (key_t key, int flag)
981 /*@modifies errno@*/;
984 msgrcv (int id, /*@out@*/ void *ptr, size_t nbytes, long type, int flags)
985 /*@modifies errno, *ptr@*/;
988 msgsnd (int id, const void *ptr, size_t nbytes, int flag)
989 /*@modifies errno@*/;
991 /*________________________________________________________________________
996 struct ipc_perm sem_perm;
997 struct sem *sem_base;
1012 struct semid_ds *buf;
1022 /*@constant int SEM_A@*/
1023 /*@constant int SEMAEM@*/
1024 /*@constant int SEMMNI@*/
1025 /*@constant int SEMMNS@*/
1026 /*@constant int SEMMNU@*/
1027 /*@constant int SEMMSL@*/
1028 /*@constant int SEMOPN@*/
1029 /*@constant int SEM_R@*/
1030 /*@constant int SEMUME@*/
1031 /*@constant int SEM_UNDO@*/
1032 /*@constant int SEMVMX@*/
1033 /*@constant int GETVAL@*/
1034 /*@constant int SETVAL@*/
1035 /*@constant int GETPID@*/
1036 /*@constant int GETNCNT@*/
1037 /*@constant int GETZCNT@*/
1038 /*@constant int GETALL@*/
1039 /*@constant int SETALL@*/
1041 /*@constant int ERMID@*/
1044 semctl (int id, int semnum, int cmd, union semun arg)
1045 /*@modifies errno@*/;
1048 semget (key_t key, int nsems, int flag)
1049 /*@modifies errno@*/;
1052 semop (int id, struct sembuf *semoparray, size_t nops)
1053 /*@modifies errno@*/;
1055 /*________________________________________________________________________
1060 struct ipc_perm shm_perm;
1072 /*@constant int SHMLBA@*/
1073 /*@constant int SHM_LOCK@*/
1074 /*@constant int SHMMAX@*/
1075 /*@constant int SHMMIN@*/
1076 /*@constant int SHMMNI@*/
1077 /*@constant int SHM_R@*/
1078 /*@constant int SHM_RDONLY@*/
1079 /*@constant int SHM_RND@*/
1080 /*@constant int SHMSEG@*/
1081 /*@constant int SHM_W@*/
1082 /*@constant int SHM_UNLOCK@*/
1085 shmat (int id, /*@null@*/ void *addr, int flag)
1086 /*@modifies errno@*/;
1089 shmctl (int id, int cmd, /*@out@*/ struct shmid_ds *buf)
1090 /*@modifies errno, *buf@*/;
1094 /*@modifies errno@*/;
1097 shmget (key_t key, int size, int flag)
1098 /*@modifies errno@*/;
1100 /*________________________________________________________________________
1104 /*@constant int LOG_EMERG@*/
1105 /*@constant int LOG_ALERT@*/
1106 /*@constant int LOG_CRIT@*/
1107 /*@constant int LOG_ERR@*/
1108 /*@constant int LOG_WARNING@*/
1109 /*@constant int LOG_NOTICE@*/
1110 /*@constant int LOG_INFO@*/
1111 /*@constant int LOG_DEBUG@*/
1113 /*@constant int LOG_KERN@*/
1114 /*@constant int LOG_USER@*/
1115 /*@constant int LOG_MAIL@*/
1116 /*@constant int LOG_DAEMON@*/
1117 /*@constant int LOG_AUTH@*/
1118 /*@constant int LOG_SYSLOG@*/
1119 /*@constant int LOG_LPR@*/
1120 /*@constant int LOG_NEWS@*/
1121 /*@constant int LOG_UUCP@*/
1122 /*@constant int LOG_CRON@*/
1123 /*@constant int LOG_AUTHPRIV@*/
1124 /*@constant int LOG_FTP@*/
1125 /*@constant int LOG_LOCAL0@*/
1126 /*@constant int LOG_LOCAL1@*/
1127 /*@constant int LOG_LOCAL2@*/
1128 /*@constant int LOG_LOCAL3@*/
1129 /*@constant int LOG_LOCAL4@*/
1130 /*@constant int LOG_LOCAL5@*/
1131 /*@constant int LOG_LOCAL6@*/
1132 /*@constant int LOG_LOCAL7@*/
1134 /*@constant int LOG_PID@*/
1135 /*@constant int LOG_CONS@*/
1136 /*@constant int LOG_ODELAY@*/
1137 /*@constant int LOG_NDELAY@*/
1138 /*@constant int LOG_NOWAIT@*/
1139 /*@constant int LOG_PERROR@*/
1151 /*@modifies fileSystem@*/;
1154 openlog (const char *ident, int logopt, int facility)
1155 /*@modifies fileSystem@*/;
1158 setlogmask (int maskpri)
1159 /*@modifies internalState@*/;
1161 extern void /*@printflike@*/
1162 syslog (int priority, const char *message, ...)
1163 /*@modifies fileSystem@*/;
1166 vsyslog (int priority, const char *message, va_list args)
1167 /*@modifies fileSystem@*/;
1169 /*________________________________________________________________________
1175 /*@modifies internalState@*/;
1177 extern /*@null@*/ struct passwd *
1179 /*@modifies internalState@*/;
1182 setpassent (int stayopen)
1183 /*@modifies internalState@*/;
1187 /*@modifies internalState@*/;
1189 /*________________________________________________________________________
1195 /*@modifies internalState@*/;
1197 extern /*@null@*/ struct group *
1199 /*@modifies internalState@*/;
1203 /*@modifies internalState@*/;
1206 setgrfile (const char *name)
1207 /*@modifies internalState@*/;
1210 setgroupent (int stayopen)
1211 /*@modifies internalState@*/;
1216 ** evans 2001-08-26 - updated from http://www.opengroup.org/onlinepubs/007908799/xsh/sysstat.h.html
1220 ** struct stat replaces POSIX version - more required fields in Unix
1224 dev_t st_dev; /* ID of device containing file */
1225 ino_t st_ino; /* file serial number */
1226 mode_t st_mode; /* mode of file (see below) */
1227 nlink_t st_nlink; /* number of links to the file */
1228 uid_t st_uid; /* user ID of file */
1229 gid_t st_gid; /* group ID of file */
1230 dev_t st_rdev; /* device ID (if file is character or block special) */
1231 off_t st_size; /* file size in bytes (if file is a regular file) */
1232 time_t st_atime; /* time of last access */
1233 time_t st_mtime; /* time of last data modification */
1234 time_t st_ctime; /* time of last status change */
1235 blksize_t st_blksize; /* a filesystem-specific preferred I/O block size for
1236 this object. In some filesystem types, this may
1237 vary from file to file */
1238 blkcnt_t st_blocks; /* number of blocks allocated for this object */
1241 /*@constant mode_t S_IFMT@*/
1242 /*@constant mode_t S_IFBLK@*/
1243 /*@constant mode_t S_IFCHR@*/
1244 /*@constant mode_t S_IFIFO@*/
1245 /*@constant mode_t S_IFREG@*/
1246 /*@constant mode_t S_IFDIR@*/
1247 /*@constant mode_t S_IFLNK@*/
1249 /*@constant mode_t S_IRWXU@*/
1250 /*@constant mode_t S_IRUSR@*/
1251 /*@constant mode_t S_IWUSR@*/
1252 /*@constant mode_t S_IXUSR@*/
1253 /*@constant mode_t S_IRWXG@*/
1254 /*@constant mode_t S_IRGRP@*/
1255 /*@constant mode_t S_IWGRP@*/
1256 /*@constant mode_t S_IXGRP@*/
1257 /*@constant mode_t S_IRWXO@*/
1258 /*@constant mode_t S_IROTH@*/
1259 /*@constant mode_t S_IWOTH@*/
1260 /*@constant mode_t S_IXOTH@*/
1261 /*@constant mode_t S_ISUID@*/
1262 /*@constant mode_t S_ISGID@*/
1263 /*@constant mode_t S_ISVTX@*/
1266 /*These are the old definitions - they don't appear to be in the Single UNIX Specification */
1268 /*@constant int S_ISTXT@*/
1269 /*@constant int S_IREAD@*/
1270 /*@constant int S_IWRITE@*/
1271 /*@constant int S_IEXEC@*/
1272 /*@constant int S_IFMT@*/
1273 /*@constant int S_IFIFO@*/
1274 /*@constant int S_IFCHR@*/
1275 /*@constant int S_IFDIR@*/
1276 /*@constant int S_IFBLK@*/
1277 /*@constant int S_IFREG@*/
1278 /*@constant int S_IFLNK@*/
1279 /*@constant int S_IFSOCK@*/
1280 /*@constant int S_ISVTX@*/
1281 /*@constant int S_ISVTX@*/
1282 /*@constant int SF_SETTABLE@*/
1283 /*@constant int SF_ARCHIVED@*/
1284 /*@constant int ACCESSPERMS@*/
1285 /*@constant int ALLPERMS@*/
1286 /*@constant int DEFFILEMODE@*/
1287 /*@constant int S_BLKSIZE@*/
1288 /*@constant int SF_IMMUTABLE@*/
1289 /*@constant int SF_APPEND@*/
1290 /*@constant int UF_NODUMP@*/
1291 /*@constant int UF_IMMUTABLE@*/
1292 /*@constant int UF_APPEND@*/
1295 int /*@alt lltX_bool@*/ S_ISBLK (/*@sef@*/ mode_t m) /*@*/;
1296 int /*@alt lltX_bool@*/ S_ISCHR (/*@sef@*/ mode_t m) /*@*/;
1297 int /*@alt lltX_bool@*/ S_ISDIR (/*@sef@*/ mode_t m) /*@*/;
1298 int /*@alt lltX_bool@*/ S_ISFIFO (/*@sef@*/ mode_t m) /*@*/;
1299 int /*@alt lltX_bool@*/ S_ISREG (/*@sef@*/ mode_t m) /*@*/;
1300 int /*@alt lltX_bool@*/ S_ISLNK (/*@sef@*/ mode_t m) /*@*/;
1302 int /*@alt lltX_bool@*/ S_TYPEISMQ (/*@sef@*/ struct stat *buf) /*@*/ ;
1303 int /*@alt lltX_bool@*/ S_TYPEISSEM (/*@sef@*/ struct stat *buf) /*@*/ ;
1304 int /*@alt lltX_bool@*/ S_TYPEISSHM (/*@sef@*/ struct stat *buf) /*@*/ ;
1306 /* in POSIX: chmod, fstat, mkdir, mkfifo, stat, umask */
1308 int lstat(const char *, /*@out@*/ struct stat *)
1310 /*@modifies errno@*/ ;
1312 int mknod (const char *, mode_t, dev_t)
1313 /*@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."@*/
1315 /*@modifies errno@*/ ;
1317 int chflags (const char *path, u_long flags)
1318 /*@warn unixstandard "Not in Single UNIX Specification Version 2"@*/
1319 /*@modifies fileSystem, errno@*/;
1321 int fchflags (int fd, u_long flags)
1322 /*@warn unixstandard "Not in Single UNIX Specification Version 2"@*/
1323 /*@modifies fileSystem, errno@*/;
1325 /*________________________________________________________________________
1329 /*@constant int FMNAMESZ@*/
1330 /*@constant int MSG_BAND@*/
1331 /*@constant int MSG_HIPRI@*/
1332 /*@constant int RS_HIPRI@*/
1333 /*@constant int S_INPUT@*/
1334 /*@constant int S_RDNORM@*/
1335 /*@constant int S_RDBAND@*/
1336 /*@constant int S_BANDURG@*/
1337 /*@constant int S_HIPRI@*/
1338 /*@constant int S_OUTPUT@*/
1339 /*@constant int S_WRNORM@*/
1340 /*@constant int S_WRBAND@*/
1341 /*@constant int S_MSG@*/
1342 /*@constant int S_ERROR@*/
1343 /*@constant int S_HANGUP@*/
1357 struct str_mlist *sl_modlist;
1361 getmsg (int fd, /*@out@*/ struct strbuf *c, /*@out@*/ struct strbuf *d, int *f)
1362 /*@modifies *c, *d, errno@*/;
1365 getpmsg (int fd, /*@out@*/ struct strbuf *c, /*@out@*/ struct strbuf *d, int *b, int *f)
1366 /*@modifies *b, *c, *d, errno@*/;
1369 putmsg (int fd, const struct strbuf *c, const struct strbuf *d, int *f)
1370 /*@modifies internalState, errno@*/;
1372 extern int putpmsg (int fd, const struct strbuf *c, const struct strbuf *d, int b, int *f)
1373 /*@modifies internalState, errno@*/;
1375 /*________________________________________________________________________
1379 /*@constant int RLIMIT_CPU@*/
1380 /*@constant int RLIMIT_FSIZE@*/
1381 /*@constant int RLIMIT_DATA@*/
1382 /*@constant int RLIMIT_STACK@*/
1383 /*@constant int RLIMIT_CORE@*/
1384 /*@constant int RLIMIT_RSS@*/
1385 /*@constant int RLIMIT_MEMLOCK@*/
1386 /*@constant int RLIMIT_NPROC@*/
1387 /*@constant int RLIMIT_NOFILE@*/
1388 /*@constant int RLIM_NLIMITS@*/
1389 /*@constant int RLIM_INFINITY@*/
1390 /*@constant int PRIO_MIN@*/
1391 /*@constant int PRIO_MAX@*/
1392 /*@constant int PRIO_PROCESS@*/
1393 /*@constant int PRIO_PGRP@*/
1394 /*@constant int PRIO_USER@*/
1395 /*@constant int RUSAGE_SELF@*/
1396 /*@constant int RUSAGE_CHILDREN@*/
1399 struct timeval ru_utime; /* user time used */
1400 struct timeval ru_stime; /* system time used */
1401 long ru_maxrss; /* max resident set size */
1402 long ru_ixrss; /* integral shared memory size */
1403 long ru_idrss; /* integral unshared data " */
1404 long ru_isrss; /* integral unshared stack " */
1405 long ru_minflt; /* page reclaims */
1406 long ru_majflt; /* page faults */
1407 long ru_nswap; /* swaps */
1408 long ru_inblock; /* block input operations */
1409 long ru_oublock; /* block output operations */
1410 long ru_msgsnd; /* messages sent */
1411 long ru_msgrcv; /* messages received */
1412 long ru_nsignals; /* signals received */
1413 long ru_nvcsw; /* voluntary context switches */
1414 long ru_nivcsw; /* involuntary " */
1423 unsigned long ldavg[3];
1428 getpriority (int which, int who)
1429 /*@modifies errno@*/;
1432 getrlimit (int res, /*@out@*/ struct rlimit *rlp)
1433 /*@modifies *rlp, errno@*/;
1436 getrusage (int who, /*@out@*/ struct rusage *rusage)
1437 /*@modifies *rusage, errno@*/;
1440 setpriority (int which, int who, int prio)
1441 /*@modifies errno, internalState@*/;
1444 setrlimit (int resource, const struct rlimit *rlp)
1445 /*@modifies errno, internalState@*/;
1454 /*@observer@*/ char *s_name; /* Official service name. */
1455 /*@observer@*/ char **s_aliases; /* Alias list. */
1456 int s_port; /* Port number. */
1457 /*@observer@*/ char *s_proto; /* Protocol to use. */
1460 /*@observer@*/ /*@dependent@*/ /*@null@*/ struct servent *getservbyname (const char *name, /*@null@*/ const char *proto)
1461 /*@warn multithreaded "Unsafe in multithreaded applications, use getsrvbyname_r instead"@*/ ;
1463 struct servent *getservbyname_r (const char *name, /*@null@*/ const char *proto, /*@out@*/ /*@returned@*/ struct servent *result, /*@out@*/ char *buffer, int buflen)
1464 /*@requires maxSet (buffer) >= buflen@*/ ;
1467 /*@observer@*/ /*@dependent@*/ struct servent *getservbyport (int port, /*@null@*/ const char *proto)
1468 /*@warn multithreaded "Unsafe in multithreaded applications, use getservbyport_r instead"@*/ ;
1470 struct servent *getservbyport_r (int port, /*@null@*/ const char *proto, /*@out@*/ /*@returned@*/ struct servent *result, /*@out@*/ char *buffer, int buflen)
1471 /*@requires maxSet (buffer) >= buflen@*/ ;
1473 /*@null@*/ struct servent *getservent (void);
1475 /*@null@*/ struct servent *getservent_r (struct servent *result, char *buffer, int buflen);
1477 int setservent (int stayopen);
1479 int endservent (void);
1484 /*@null@*/ /*@observer@*/ struct hostent *gethostbyname (/*@nullterminated@*/ /*@notnull@*/ const char *name)
1485 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostbyname_r instead"@*/
1486 /*@modifies h_errno@*/ ;
1488 struct hostent *gethostbyname_r (/*@nullterminated@*/ const char *name, /*@notnull@*/ /*@returned@*/ struct hostent *hent, /*@out@*/ /*@exposed@*/ char *buffer, int bufsize, /*@out@*/ int *h_errnop)
1489 /*@requires maxSet(buffer) >= bufsize@*/ ;
1491 /*@null@*/ /*@observer@*/ struct hostent *gethostbyaddr (/*@notnull@*/ const void *addr, size_t addrlen, int type)
1492 /*@requires maxRead(addr) == addrlen@*/ /*@i534 ??? is this right? */
1493 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostbyaddr_r instead"@*/
1494 /*@modifies h_errno@*/ ;
1496 struct hostent *gethostbyaddr_r (/*@notnull@*/ const void *addr, size_t addrlen, int type,
1497 /*@returned@*/ /*@out@*/ struct hostent *hent,
1498 /*@exposed@*/ /*@out@*/ char *buffer, int bufsize, /*@out@*/ int *h_errnop)
1499 /*@requires maxRead(addr) == addrlen
1500 /\ maxSet(buffer) >= bufsize@*/ /*@i534 ??? is this right? */ ;
1502 /*@observer@*/ /*@null@*/ struct hostent *gethostent (void)
1503 /*@warn multithreaded "Unsafe in multithreaded applications, use gethostent_r instead"@*/ ;
1505 struct hostent *gethostent_r (/*@out@*/ /*@returned@*/ struct hostent *hent, /*@exposed@*/ /*@out@*/ char *buffer, int bufsize)
1506 /*@requires maxSet(buffer) >= bufsize@*/ ;
1508 /*@i534 need to annotate these: */
1509 struct hostent *fgethostent(FILE *f);
1511 struct hostent *fgethostent_r(FILE*f, struct hostent *hent, char buffer, int bufsize);
1513 void sethostent(int stayopen);
1515 void endhostent(void);
1517 void herror(const char *string);
1519 char *hstrerror(int err);
1522 /*@observer@*/ /*@nullterminated@*/ char *h_name; /* official name of host */
1523 /*@observer@*/ /*@nullterminated@*/ char * /*:observer@*/ /*:nullterminated@*/ *h_aliases; /* alias list */
1524 int h_addrtype; /* host address type*/
1525 int h_length; /* length ofaddress*/
1526 /*@observer@*/ /*@nullterminated@*/ char * /*:observer@*/ /*:nullterminated@*/ *h_addr_list; /* list of addressesfrom name server */
1527 /*@observer@*/ /*@nullterminated@*/ char *h_addr; /* first address in list (backward compatibility) */
1534 typedef uint32_t in_addr_t;
1541 typedef uint16_t in_port_t;
1543 in_addr_t htonl (in_addr_t hostlong) /*@*/ ;
1544 in_port_t htons (in_port_t hostshort) /*@*/ ;
1545 in_addr_t ntohl (in_addr_t netlong) /*@*/ ;
1546 in_port_t ntohs (in_port_t netshort) /*@*/ ;
1552 int chroot (/*@notnull@*/ /*@nullterminated@*/ const char *path)
1554 /*@warn superuser "Only super-user processes may call chroot."@*/
1555 /*: other wanings? */ ;
1557 int fchroot (int fildes)
1559 /*@warn superuser "Only super-user processes may call fchroot."@*/ ;
1564 ** evans 2001-08-26 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/ctype.h.html
1568 lltX_bool isascii(int) /*@*/ ;
1569 lltX_bool toascii(int) /*@*/ ;
1570 char _toupper(/*@sef@*/ int) /*@*/ ;
1571 char _tolower(/*@sef@*/ int) /*@*/ ;
1573 lltX_bool /*@alt int@*/ isascii(int /*@alt unsigned char@*/) /*@*/ ;
1574 lltX_bool /*@alt int@*/ toascii(int /*@alt unsigned char@*/);
1575 char /*@alt int@*/ _toupper(/*@sef@*/ int /*@alt unsigned char@*/);
1576 char /*@alt int@*/ _tolower(/*@sef@*/ int /*@alt unsigned char@*/);
1579 /* other ctype.h functions in ansi.h */
1584 ** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/drand48.html
1587 double drand48 (void) /*@modifies internalState@*/ ;
1588 double erand48 (unsigned short int xsubi[3]) /*@modifies internalState@*/ ;
1589 void srand48 (long int seedval) /*@modifies internalState@*/ ;
1594 ** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xns/netinetin.h.html
1597 typedef /*@unsignedintegraltype@*/ in_port_t; /* An unsigned integral type of exactly 16 bits. */
1598 typedef /*@unsignedintegraltype@*/ in_addr_t; /* An unsigned integral type of exactly 32 bits. */
1600 typedef /*@unsignedintegraltype@*/ sa_family_t;
1606 struct sockaddr_in {
1607 sa_family_t sin_family;
1609 struct in_addr sin_addr;
1610 unsigned char sin_zero[8];
1614 /* The <netinet/in.h> header defines the following macros for use as values of the level argument of
1615 getsockopt() and setsockopt():
1618 /*@constant int IPPROTO_IP@*/
1619 /*@constant int IPPROTO_ICMP@*/
1620 /*@constant int IPPROTO_TCP@*/
1621 /*@constant int IPPROTO_UDP@*/
1623 /* The <netinet/in.h> header defines the following macros for use as destination addresses for connect(), sendmsg() and sendto():
1626 /*@constant in_addr_t INADDR_ANY@*/
1627 /*@constant in_addr_t INADDR_BROADCAST@*/
1632 ** evans 2001-08-27 - added from http://www.opengroup.org/onlinepubs/007908799/xsh/dirent.h.html
1641 typedef /*@abstract@*/ DIR;
1643 /*@i32 need to check annotations on these */
1644 int closedir (DIR *) /*:errorcode -1*/ ;
1645 /*@null@*/ DIR *opendir(const char *) ;
1646 struct dirent *readdir(DIR *);
1647 int readdir_r(DIR *, struct dirent *, struct dirent **);
1648 void rewinddir(DIR *);
1649 void seekdir(DIR *, long int);
1650 long int telldir(DIR *);
1652 /*drl added these functions
1653 stpcpy and stpncpy are found on linux but
1654 don't seem to be present on other unixes
1656 thanks to Jeff Johnson for pointing out that
1657 these functions were in the unix library
1660 /* this function is like strcpy but it reutrns a pointer to the null terminated character in dest instead of the beginning of dest */
1662 extern char * stpcpy(/*@out@*/ /*@returned@*/ char * dest, const char * src)
1663 /*@modifies *dest @*/
1664 /*@requires maxSet(dest) >= maxRead(src) @*/
1665 /*@ensures MaxRead(dest) == MaxRead (src) /\ MaxRead(result) == 0 /\ MaxSet(result) == ( maxSet(dest) - MaxRead(src) ); @*/;
1668 extern char * stpncpy(/*@out@*/ /*@returned@*/ char * dest,
1669 const char * src, size_t n)
1670 /*@modifies *dest @*/
1671 /*@requires MaxSet(dest) >= ( n - 1 ); @*/ /*@ensures MaxRead (src) >= MaxRead(dest) /\ MaxRead (dest) <= n; @*/