]>
Commit | Line | Data |
---|---|---|
885824d3 | 1 | /* |
2 | ** unix.h | |
3 | */ | |
4 | ||
5 | /*@-nextlinemacros@*/ | |
6 | ||
7 | /* | |
8 | ** Extra stuff in some unixen, not in posix. | |
9 | */ | |
10 | ||
11 | /*@unchecked@*/ int signgam; | |
12 | ||
13 | typedef /*@integraltype@*/ clockid_t; | |
14 | ||
15 | extern void bcopy (char *b1, /*@out@*/ char *b2, int length) | |
16 | /*@modifies *b2@*/ ; /* Yes, the second parameter is the out param! */ | |
17 | ||
18 | extern int /*@alt lltX_bool@*/ bcmp (char *b1, char *b2, int length) /*@*/ ; | |
19 | /* Return value is NOT like strcmp! */ | |
20 | ||
21 | extern void bzero (/*@out@*/ char *b1, int length) /*@modifies *b1@*/ ; | |
22 | extern int ffs (int i) /*@*/ ; | |
23 | extern int symlink (char *name1, char *name2) /*@modifies fileSystem@*/ ; | |
24 | ||
25 | extern int | |
26 | setvbuf_unlocked (FILE *stream, /*@null@*/ /*@exposed@*/ char *buf, | |
27 | int mode, size_t size) | |
28 | /*@modifies internalState@*/ ; | |
29 | ||
30 | extern void | |
31 | setbuffer (FILE *stream, /*@null@*/ /*@exposed@*/ char *buf, int size) | |
32 | /*@modifies internalState@*/ ; | |
33 | ||
34 | extern void setlinebuf (FILE *stream) /*@modifies internalState@*/ ; | |
35 | ||
36 | extern int strerror_r (int errnum, /*@out@*/ char *strerrbuf, int buflen) | |
37 | /*@modifies strerrbuf@*/ ; | |
38 | ||
39 | extern size_t | |
40 | fread_unlocked (/*@out@*/ void *ptr, size_t size, size_t nitems, | |
41 | FILE *stream) | |
42 | /*@modifies *stream, *ptr;@*/ ; | |
43 | ||
44 | extern size_t | |
45 | fwrite_unlocked (void *pointer, size_t size, size_t num_items, FILE *stream) | |
46 | /*@modifies *stream;@*/ ; | |
47 | ||
48 | extern void funlockfile (FILE *file) /*@modifies *file;@*/ ; | |
49 | extern void flockfile (FILE *file) /*@modifies *file@*/ ; | |
50 | ||
51 | extern void /*@alt void * @*/ | |
52 | memccpy (/*@returned@*/ /*@out@*/ void *s1, | |
53 | /*@unique@*/ void *s2, int c, size_t n) | |
54 | /*@modifies *s1@*/ ; | |
55 | ||
56 | extern int strcasecmp (char *s1, char *s2) /*@*/ ; | |
57 | extern int strncasecmp (char *s1, char *s2, int n) /*@*/ ; | |
58 | extern char *strdup (char *s) /*@*/ ; | |
59 | ||
60 | extern /*@null@*/ char *tempnam (char *dir, /*@null@*/ char *pfx) | |
61 | /*@modifies internalState@*/ ; | |
62 | ||
63 | extern /*@null@*/ /*@dependent@*/ char * | |
64 | index (/*@returned@*/ char *s, char c) /*@*/ ; | |
65 | ||
66 | extern /*@null@*/ /*@dependent@*/ char * | |
67 | rindex (/*@returned@*/ char *s, char c) /*@*/ ; | |
68 | ||
69 | extern /*@dependent@*/ /*@null@*/ FILE *popen (char *command, char *ttype) | |
70 | /*@modifies fileSystem, errno@*/ ; | |
71 | extern int pclose (FILE *stream) /*@modifies fileSystem, *stream, errno@*/ ; | |
72 | ||
73 | extern double cbrt (double x) /*@modifies errno@*/ ; | |
74 | extern double rint (double x) /*@*/ ; | |
75 | extern double trunc (double x) /*@*/ ; | |
76 | ||
77 | /*@constant int ENOTBLK@*/ | |
78 | /*@constant int ETXTBSY@*/ | |
79 | /*@constant int EWOULDBLOCK@*/ | |
80 | /*@constant int EINPROGRESS@*/ | |
81 | /*@constant int EALREADY@*/ | |
82 | /*@constant int ENOTSOCK@*/ | |
83 | /*@constant int EDESTADDRREQ@*/ | |
84 | /*@constant int EMSGSIZE@*/ | |
85 | /*@constant int EPROTOTYPE@*/ | |
86 | /*@constant int ENOPROTOOPT@*/ | |
87 | /*@constant int EPROTONOSUPPORT@*/ | |
88 | /*@constant int ESOCKTNOSUPPORT@*/ | |
89 | /*@constant int EOPNOTSUPP@*/ | |
90 | /*@constant int EPFNOSUPPORT@*/ | |
91 | /*@constant int EAFNOSUPPORT@*/ | |
92 | /*@constant int EADDRINUSE@*/ | |
93 | /*@constant int EADDRNOTAVAIL@*/ | |
94 | /*@constant int ENETDOWN@*/ | |
95 | /*@constant int ENETUNREACH@*/ | |
96 | /*@constant int ENETRESET@*/ | |
97 | /*@constant int ECONNABORTED@*/ | |
98 | /*@constant int ECONNRESET@*/ | |
99 | /*@constant int ENOBUFS@*/ | |
100 | /*@constant int EISCONN@*/ | |
101 | /*@constant int ENOTCONN@*/ | |
102 | /*@constant int ESHUTDOWN@*/ | |
103 | /*@constant int ETOOMANYREFS@*/ | |
104 | /*@constant int ETIMEDOUT@*/ | |
105 | /*@constant int ECONNREFUSED@*/ | |
106 | /*@constant int ENAMETOOLONG@*/ | |
107 | /*@constant int EHOSTDOWN@*/ | |
108 | /*@constant int EHOSTUNREACH@*/ | |
109 | /*@constant int ENOTEMPTY@*/ | |
110 | /*@constant int EPROCLIM@*/ | |
111 | /*@constant int EUSERS@*/ | |
112 | /*@constant int EDQUOT@*/ | |
113 | /*@constant int ESTALE@*/ | |
114 | /*@constant int EREMOTE@*/ | |
115 | /*@constant int ENOMSG@*/ | |
116 | /*@constant int EIDRM@*/ | |
117 | /*@constant int EALIGN@*/ | |
118 | /*@constant int EDEADLK@*/ | |
119 | /*@constant int ENOLCK@*/ | |
120 | /*@constant int ENOSYS@*/ | |
121 | /*@constant int EACTIVE@*/ | |
122 | /*@constant int ENOACTIVE@*/ | |
123 | /*@constant int ENORESOURCES@*/ | |
124 | /*@constant int ENOSYSTEM@*/ | |
125 | /*@constant int ENODUST@*/ | |
126 | /*@constant int EDUPNOCONN@*/ | |
127 | /*@constant int EDUPNODISCONN@*/ | |
128 | /*@constant int EDUPNOTCNTD@*/ | |
129 | /*@constant int EDUPNOTIDLE@*/ | |
130 | /*@constant int EDUPNOTWAIT@*/ | |
131 | /*@constant int EDUPNOTRUN@*/ | |
132 | /*@constant int EDUPBADOPCODE@*/ | |
133 | /*@constant int EDUPINTRANSIT@*/ | |
134 | /*@constant int EDUPTOOMANYCPUS@*/ | |
135 | /*@constant int ELOOP@*/ | |
136 | ||
137 | /*@constant int LOCK_MAX@*/ | |
138 | /*@constant int FCHR_MAX@*/ | |
139 | /*@constant int USI_MAX@*/ | |
140 | /*@constant int WORD_BIT@*/ | |
141 | /*@constant int LONG_BIT@*/ | |
142 | /*@constant long NAME_MAX@*/ | |
143 | /*@constant long NGROUPS_MAX@*/ | |
144 | /*@constant long MAX_INPUT@*/ | |
145 | /*@constant long MAX_CANON@*/ | |
146 | /*@constant int MAX_CHAR@*/ | |
147 | /*@constant long OPEN_MAX@*/ | |
148 | /*@constant int PASS_MAX@*/ | |
149 | /*@constant int PATH_MAX@*/ | |
150 | /*@constant int PID_MAX@*/ | |
151 | /*@constant int SYSPID_MAX@*/ | |
152 | /*@constant long PIPE_BUF@*/ | |
153 | /*@constant int PIPE_MAX@*/ | |
154 | /*@constant int PROC_MAX@*/ | |
155 | /*@constant int STD_BLK@*/ | |
156 | /*@constant int SYS_NMLN@*/ | |
157 | /*@constant int SYS_OPEN@*/ | |
158 | /*@constant int NZERO@*/ | |
159 | /*@constant int UID_MAX@*/ | |
160 | /*@constant long MB_LEN_MAX@*/ | |
161 | /*@constant int NL_ARGMAX@*/ | |
162 | /*@constant int NL_MSGMAX@*/ | |
163 | /*@constant int NL_NMAX@*/ | |
164 | /*@constant int NL_SETMAX@*/ | |
165 | /*@constant int NL_TEXTMAX@*/ | |
166 | /*@constant int NL_LBLMAX@*/ | |
167 | /*@constant int NL_LANGMAX @*/ | |
168 | ||
169 | /*@constant double M_E@*/ | |
170 | /*@constant double M_LOG2E@*/ | |
171 | /*@constant double M_LOG10E@*/ | |
172 | /*@constant double M_LN2@*/ | |
173 | /*@constant double M_LN10@*/ | |
174 | /*@constant double M_PI@*/ | |
175 | /*@constant double M_PI_2@*/ | |
176 | /*@constant double M_PI_4@*/ | |
177 | /*@constant double M_1_PI@*/ | |
178 | /*@constant double M_2_PI@*/ | |
179 | /*@constant double M_2_SQRTPI@*/ | |
180 | /*@constant double M_SQRT2@*/ | |
181 | /*@constant double M_SQRT1_2@*/ | |
182 | ||
183 | /*@constant double MAXFLOAT@*/ | |
184 | /*@constant double HUGE@*/ | |
185 | ||
186 | /*@constant int DOMAIN@*/ | |
187 | /*@constant int SING@*/ | |
188 | /*@constant int OVERFLOW@*/ | |
189 | /*@constant int UNDERFLOW@*/ | |
190 | /*@constant int TLOSS@*/ | |
191 | /*@constant int PLOSS@*/ | |
192 | ||
193 | extern /*@unchecked@*/ int daylight; | |
194 | extern /*@unchecked@*/ long timezone; | |
195 | extern /*@unchecked@*/ char *tzname[]; | |
196 | ||
197 | /*@-incondefs@*/ | |
198 | extern void tzset(void) /*@modifies daylight, timezone, tzname@*/ ; | |
199 | /*@=incondefs@*/ | |
200 | ||
201 | typedef unsigned char uchar_t; | |
202 | typedef unsigned short ushort_t; | |
203 | typedef unsigned int uint_t; | |
204 | typedef unsigned long ulong_t; | |
205 | typedef volatile unsigned char vuchar_t; | |
206 | typedef volatile unsigned short vushort_t; | |
207 | typedef volatile unsigned int vuint_t; | |
208 | typedef volatile unsigned long vulong_t; | |
209 | typedef long label_t; | |
210 | typedef int level_t; | |
211 | typedef /*@integraltype@*/ daddr_t; | |
212 | typedef char *caddr_t; | |
213 | typedef long *qaddr_t; | |
214 | typedef char *addr_t; | |
215 | typedef long physadr_t; | |
216 | typedef short cnt_t; | |
217 | typedef int chan_t; | |
218 | typedef unsigned long rlim_t; | |
219 | typedef int paddr_t; | |
220 | typedef /*@integraltype@*/ key_t; | |
221 | typedef void *mid_t; | |
222 | typedef char slab_t[12]; | |
223 | typedef ulong_t shmatt_t; | |
224 | typedef ulong_t msgqnum_t; | |
225 | typedef ulong_t msglen_t; | |
226 | typedef long timer_t; | |
227 | typedef uchar_t uchar; | |
228 | typedef ushort_t ushort; | |
229 | typedef uint_t uint; | |
230 | typedef ulong_t ulong; | |
231 | typedef uchar_t u_char; | |
232 | typedef ushort_t u_short; | |
233 | typedef uint_t u_int; | |
234 | typedef ulong_t u_long; | |
235 | typedef vuchar_t vu_char; | |
236 | typedef vushort_t vu_short; | |
237 | typedef vuint_t vu_int; | |
238 | typedef vulong_t vu_long; | |
239 | typedef long swblk_t; | |
240 | typedef u_long fixpt_t; | |
241 | typedef long segsz_t; | |
242 | typedef /*@abstract@*/ fd_set; | |
243 | ||
244 | int ttyname_r (int fg, /*@out@*/ char *buffer, int len) /*@modifies buffer@*/ ; | |
245 | int ioctl (int d, int /*@alt long@*/ request, /*@out@*/ void *arg) | |
246 | /*@modifies *arg, errno@*/ ; /* depends on request! */ | |
247 | ||
248 | int gethostname (/*@out@*/ char *address, int address_len) | |
249 | /*@modifies address@*/ ; | |
250 | ||
251 | pid_t vfork (void) /*@modifies fileSystem@*/ ; | |
252 | ||
253 | ||
254 | struct iovec { | |
255 | void *iov_base; | |
256 | size_t iov_len; | |
257 | }; | |
258 | ||
259 | /*@constant int UIO_MAXIOV@*/ /* BSD */ | |
260 | /*@constant int IOV_MAX@*/ /* supposedly SVR4 */ | |
261 | ||
262 | extern ssize_t | |
263 | readv (int fd, const struct iovec iov[], int iovcnt) | |
264 | /*@modifies iov[].iov_base, fileSystem, errno@*/; | |
265 | ||
266 | extern ssize_t | |
267 | writev (int fd, const struct iovec iov[], int iovcnt) | |
268 | /*@modifies errno@*/; | |
269 | ||
270 | /*________________________________________________________________________ | |
271 | * poll.h | |
272 | */ | |
273 | ||
274 | struct poll { | |
275 | int fd; | |
276 | short events; | |
277 | short revents; | |
278 | }; | |
279 | ||
280 | /*@constant short POLLIN@*/ | |
281 | /*@constant short POLLRDNORM@*/ | |
282 | /*@constant short POLLRDBAND@*/ | |
283 | /*@constant short POLLPRI@*/ | |
284 | /*@constant short POLLOUT@*/ | |
285 | /*@constant short POLLWRNORM@*/ | |
286 | /*@constant short POLLWRBAND@*/ | |
287 | /*@constant short POLLERR@*/ | |
288 | /*@constant short POLLHUP@*/ | |
289 | /*@constant short POLLNVAL@*/ | |
290 | ||
291 | extern int poll (struct poll pollfd[], unsigned long nfds, int timeout) | |
292 | /*@modifies pollfd[].revents, errno@*/ ; | |
293 | ||
294 | /* | |
295 | ** free does not take null | |
296 | */ | |
297 | ||
298 | /*@-incondefs@*/ | |
299 | extern void free (/*@notnull@*/ /*@out@*/ /*@only@*/ void *p) /*@modifies *p@*/ ; | |
300 | /*@=incondefs@*/ | |
301 | ||
302 | /*________________________________________________________________________ | |
303 | * sys/socket.h | |
304 | */ | |
305 | ||
306 | /*@constant int SOCK_STREAM@*/ | |
307 | /*@constant int SOCK_DGRAM@*/ | |
308 | /*@constant int SOCK_RAW@*/ | |
309 | /*@constant int SOCK_RDM@*/ | |
310 | /*@constant int SOCK_SEQPACKET@*/ | |
311 | /*@constant int SO_DEBUG@*/ | |
312 | /*@constant int SO_ACCEPTCONN@*/ | |
313 | /*@constant int SO_REUSEADDR@*/ | |
314 | /*@constant int SO_KEEPALIVE@*/ | |
315 | /*@constant int SO_DONTROUTE@*/ | |
316 | /*@constant int SO_BROADCAST@*/ | |
317 | /*@constant int SO_USELOOPBACK@*/ | |
318 | /*@constant int SO_LINGER@*/ | |
319 | /*@constant int SO_OOBINLINE@*/ | |
320 | /*@constant int SO_REUSEPORT@*/ | |
321 | /*@constant int SO_SNDBUF@*/ | |
322 | /*@constant int SO_RCVBUF@*/ | |
323 | /*@constant int SO_SNDLOWAT@*/ | |
324 | /*@constant int SO_RCVLOWAT@*/ | |
325 | /*@constant int SO_SNDTIMEO@*/ | |
326 | /*@constant int SO_RCVTIMEO@*/ | |
327 | /*@constant int SO_ERROR@*/ | |
328 | /*@constant int SO_TYPE@*/ | |
329 | /*@constant int SOL_SOCKET@*/ | |
330 | /*@constant int AF_UNSPEC@*/ | |
331 | /*@constant int AF_LOCAL@*/ | |
332 | /*@constant int AF_UNIX@*/ | |
333 | /*@constant int AF_INET@*/ | |
334 | /*@constant int AF_IMPLINK@*/ | |
335 | /*@constant int AF_PUP@*/ | |
336 | /*@constant int AF_CHAOS@*/ | |
337 | /*@constant int AF_NS@*/ | |
338 | /*@constant int AF_ISO@*/ | |
339 | /*@constant int AF_OSI@*/ | |
340 | /*@constant int AF_ECMA@*/ | |
341 | /*@constant int AF_DATAKIT@*/ | |
342 | /*@constant int AF_CCITT@*/ | |
343 | /*@constant int AF_SNA@*/ | |
344 | /*@constant int AF_DECnet@*/ | |
345 | /*@constant int AF_DLI@*/ | |
346 | /*@constant int AF_LAT@*/ | |
347 | /*@constant int AF_HYLINK@*/ | |
348 | /*@constant int AF_APPLETALK@*/ | |
349 | /*@constant int AF_ROUTE@*/ | |
350 | /*@constant int AF_LINK@*/ | |
351 | /*@constant int pseudo_AF_XTP@*/ | |
352 | /*@constant int AF_COIP@*/ | |
353 | /*@constant int AF_CNT@*/ | |
354 | /*@constant int pseudo_AF_RTIP@*/ | |
355 | /*@constant int AF_IPX@*/ | |
356 | /*@constant int AF_SIP@*/ | |
357 | /*@constant int pseudo_AF_PIP@*/ | |
358 | /*@constant int AF_ISDN@*/ | |
359 | /*@constant int AF_E164@*/ | |
360 | /*@constant int AF_MAX@*/ | |
361 | /*@constant int MSG_OOB@*/ | |
362 | /*@constant int MSG_PEEK@*/ | |
363 | /*@constant int MSG_DONTROUTE@*/ | |
364 | /*@constant int MSG_EOR@*/ | |
365 | /*@constant int MSG_TRUNC@*/ | |
366 | /*@constant int MSG_CTRUNC@*/ | |
367 | /*@constant int MSG_WAITALL@*/ | |
368 | /*@constant int MSG_DONTWAIT@*/ | |
369 | /*@constant int MSG_EOF@*/ | |
370 | /*@constant int MSG_COMPAT@*/ | |
371 | /*@constant int PF_UNSPEC@*/ | |
372 | /*@constant int PF_LOCAL@*/ | |
373 | /*@constant int PF_UNIX@*/ | |
374 | /*@constant int PF_INET@*/ | |
375 | /*@constant int PF_IMPLINK@*/ | |
376 | /*@constant int PF_PUP@*/ | |
377 | /*@constant int PF_CHAOS@*/ | |
378 | /*@constant int PF_NS@*/ | |
379 | /*@constant int PF_ISO@*/ | |
380 | /*@constant int PF_OSI@*/ | |
381 | /*@constant int PF_ECMA@*/ | |
382 | /*@constant int PF_DATAKIT@*/ | |
383 | /*@constant int PF_CCITT@*/ | |
384 | /*@constant int PF_SNA@*/ | |
385 | /*@constant int PF_DECnet@*/ | |
386 | /*@constant int PF_DLI@*/ | |
387 | /*@constant int PF_LAT@*/ | |
388 | /*@constant int PF_HYLINK@*/ | |
389 | /*@constant int PF_APPLETALK@*/ | |
390 | /*@constant int PF_ROUTE@*/ | |
391 | /*@constant int PF_LINK@*/ | |
392 | /*@constant int PF_XTP@*/ | |
393 | /*@constant int PF_COIP@*/ | |
394 | /*@constant int PF_CNT@*/ | |
395 | /*@constant int PF_SIP@*/ | |
396 | /*@constant int PF_IPX@*/ | |
397 | /*@constant int PF_RTIP@*/ | |
398 | /*@constant int PF_PIP@*/ | |
399 | /*@constant int PF_ISDN@*/ | |
400 | /*@constant int PF_MAX@*/ | |
401 | /*@constant int NET_MAXID@*/ | |
402 | /*@constant int NET_RT_DUMP@*/ | |
403 | /*@constant int NET_RT_FLAGS@*/ | |
404 | /*@constant int NET_RT_IFLIST@*/ | |
405 | /*@constant int NET_RT_MAXID@*/ | |
406 | /*@constant int SOMAXCONN@*/ | |
407 | /*@constant int SCM_RIGHTS@*/ | |
408 | ||
409 | struct sockaddr { | |
410 | u_char sa_len; /* total length */ | |
411 | u_char sa_family; /* address family */ | |
412 | char sa_data[14]; /* actually longer; address value */ | |
413 | }; | |
414 | ||
415 | struct linger { | |
416 | int l_onoff; /* option on/off */ | |
417 | int l_linger; /* linger time */ | |
418 | }; | |
419 | ||
420 | struct sockproto { | |
421 | u_short sp_family; /* address family */ | |
422 | u_short sp_protocol; /* protocol */ | |
423 | }; | |
424 | struct msghdr { | |
425 | caddr_t msg_name; /* optional address */ | |
426 | u_int msg_namelen; /* size of address */ | |
427 | struct iovec *msg_iov; /* scatter/gather array */ | |
428 | u_int msg_iovlen; /* # elements in msg_iov */ | |
429 | caddr_t msg_control; /* ancillary data, see below */ | |
430 | u_int msg_controllen; /* ancillary data buffer len */ | |
431 | int msg_flags; /* flags on received message */ | |
432 | }; | |
433 | ||
434 | struct cmsghdr { | |
435 | u_int cmsg_len; /* data byte count, including hdr */ | |
436 | int cmsg_level; /* originating protocol */ | |
437 | int cmsg_type; /* protocol-specific type */ | |
438 | /* followed by u_char cmsg_data[]; */ | |
439 | }; | |
440 | ||
441 | extern int | |
442 | accept (int s, struct sockaddr *addr, int *addrlen) | |
443 | /*@modifies *addrlen, errno@*/; | |
444 | ||
445 | extern int | |
446 | bind (int s, struct sockaddr *name, int namelen) | |
447 | /*@modifies errno, fileSystem@*/; | |
448 | ||
449 | extern int | |
450 | connect (int s, struct sockaddr *name, int namelen) | |
451 | /*@modifies errno, internalState@*/; | |
452 | ||
453 | extern int | |
454 | getpeername (int s, /*@out@*/ struct sockaddr *name, int *namelen) | |
455 | /*@modifies *name, *namelen, errno@*/; | |
456 | ||
457 | extern int | |
458 | getsockname (int s, struct sockaddr *name, int *namelen) | |
459 | /*@modifies *name, *namelen, errno@*/; | |
460 | ||
461 | extern int | |
462 | getsockopt (int s, int level, int optname, /*@out@*/ void *optval, int *optlen) | |
463 | /*@modifies *optval, *optlen, errno@*/; | |
464 | ||
465 | extern int | |
466 | listen (int s, int backlog) | |
467 | /*@modifies errno, internalState@*/; | |
468 | ||
469 | extern ssize_t | |
470 | recv (int s, /*@out@*/ void *buf, size_t len, int flags) | |
471 | /*@modifies *buf, errno@*/; | |
472 | ||
473 | extern ssize_t | |
474 | recvfrom (int s, void *buf, size_t len, int flags, /*@null@*/ struct sockaddr *from, int *fromlen) | |
475 | /*@modifies *buf, *from, *fromlen, errno@*/; | |
476 | ||
477 | extern ssize_t | |
478 | recvmsg (int s, struct msghdr *msg, int flags) | |
479 | /*@modifies msg->msg_iov->iov_base[], errno@*/; | |
480 | ||
481 | extern ssize_t | |
482 | send (int s, const void *msg, size_t len, int flags) | |
483 | /*@modifies errno@*/; | |
484 | ||
485 | extern ssize_t | |
486 | sendto (int s, const void *msg, size_t len, int flags, const struct sockaddr *to, int tolen) | |
487 | /*@modifies errno@*/; | |
488 | ||
489 | extern ssize_t | |
490 | sendmsg (int s, const struct msghdr *msg, int flags) | |
491 | /*@modifies errno@*/; | |
492 | ||
493 | extern int | |
494 | setsockopt (int s, int level, int optname, const void *optval, int optlen) | |
495 | /*@modifies internalState, errno@*/; | |
496 | ||
497 | extern int | |
498 | shutdown (int s, int how) | |
499 | /*@modifies errno@*/; | |
500 | ||
501 | extern int | |
502 | socket (int domain, int type, int protocol) | |
503 | /*@modifies errno@*/; | |
504 | ||
505 | extern int | |
506 | socketpair (int d, int type, int protocol, /*@out@*/ int *sv) | |
507 | /*@modifies errno@*/; | |
508 | ||
509 | /*@constant int BADSIG@*/ | |
510 | /*@constant int SA_ONSTACK@*/ | |
511 | /*@constant int SA_RESTART@*/ | |
512 | /*@constant int SA_DISABLE@*/ | |
513 | /*@constant int SIGBUS@*/ | |
514 | /*@constant int SIGEMT@*/ | |
515 | /*@constant int SIGINFO@*/ | |
516 | /*@constant int SIGIO@*/ | |
517 | /*@constant int SIGIOT@*/ | |
518 | /*@constant int SIGPOLL@*/ | |
519 | /*@constant int SIGPROF@*/ | |
520 | /*@constant int SIGPWR@*/ | |
521 | /*@constant int SIGSYS@*/ | |
522 | /*@constant int SIGTRAP@*/ | |
523 | /*@constant int SIGURG@*/ | |
524 | /*@constant int SIGVTALRM@*/ | |
525 | /*@constant int SIGWINCH@*/ | |
526 | /*@constant int SIGXCPU@*/ | |
527 | /*@constant int SIGXFSZ@*/ | |
528 | ||
529 | extern void psignal (int sig, const char *msg) | |
530 | /*@modifies fileSystem@*/; | |
531 | ||
532 | /*@unchecked@*/ extern char *optarg; | |
533 | /*@unchecked@*/ extern int optind; | |
534 | /*@unchecked@*/ extern int optopt; | |
535 | /*@unchecked@*/ extern int opterr; | |
536 | /*@unchecked@*/ extern int optreset; | |
537 | ||
538 | extern int | |
539 | getopt (int argc, char * const *argv, const char *optstring) | |
540 | /*@globals optarg, optind, optopt, opterr, optreset@*/ | |
541 | /*@modifies optarg, optind, optopt@*/; | |
542 | ||
543 | extern int | |
544 | setenv (const char *name, const char *value, int overwrite) | |
545 | /*@globals environ@*/ | |
546 | /*@modifies *environ, errno@*/; | |
547 | ||
548 | extern int | |
549 | putenv (const char *string) | |
550 | /*@globals environ@*/ | |
551 | /*@modifies *environ, errno@*/; | |
552 | ||
553 | extern void | |
554 | unsetenv (const char *name) | |
555 | /*@globals environ@*/ | |
556 | /*@modifies *environ@*/; | |
557 | ||
558 | /*________________________________________________________________________ | |
559 | * sys/wait.h | |
560 | */ | |
561 | ||
562 | extern int | |
563 | WCOREDUMP (int x) | |
564 | /*@*/; | |
565 | ||
566 | extern int | |
567 | W_EXITCODE (int ret, int sig) | |
568 | /*@*/; | |
569 | ||
570 | extern int | |
571 | W_STOPCODE (int sig) | |
572 | /*@*/; | |
573 | ||
574 | /*@constant int WAIT_ANY@*/ | |
575 | /*@constant int WAIT_MYPGRP@*/ | |
576 | /*@constant int WSTOPPED@*/ | |
577 | ||
578 | extern pid_t | |
579 | wait3 (int *statloc, int options, /*@null@*/ /*@out@*/ struct rusage *rusage) | |
580 | /*@modifies *statloc, *rusage, errno@*/; | |
581 | ||
582 | extern pid_t | |
583 | wait4 (pid_t p, int *statloc, int opt, /*@null@*/ /*@out@*/ struct rusage *r) | |
584 | /*@modifies *statloc, *r, errno@*/; | |
585 | ||
586 | struct timeval { | |
587 | long tv_sec; | |
588 | long tv_usec; | |
589 | } ; | |
590 | ||
591 | struct timespec { | |
592 | long ts_sec; | |
593 | long ts_nsec; | |
594 | } ; | |
595 | ||
596 | struct timezone { | |
597 | int tz_minuteswest; | |
598 | int tz_dsttime; | |
599 | } ; | |
600 | ||
601 | /*@constant int DST_NONE@*/ | |
602 | /*@constant int DST_USA@*/ | |
603 | /*@constant int DST_AUST@*/ | |
604 | /*@constant int DST_WET@*/ | |
605 | /*@constant int DST_MET@*/ | |
606 | /*@constant int DST_EET@*/ | |
607 | /*@constant int DST_CAN@*/ | |
608 | ||
609 | /*@constant int ITIMER_PROF@*/ | |
610 | /*@constant int ITIMER_REAL@*/ | |
611 | /*@constant int ITIMER_VIRTUAL@*/ | |
612 | ||
613 | struct itimerval { | |
614 | struct timeval it_interval; | |
615 | struct timeval it_value; | |
616 | }; | |
617 | ||
618 | struct clockinfo { | |
619 | int hz; | |
620 | int tick; | |
621 | int stathz; | |
622 | int profhz; | |
623 | }; | |
624 | ||
625 | extern int | |
626 | adjtime (const struct timeval *delta, /*@null@*/ /*@out@*/ struct timeval *olddelta) | |
627 | /*@modifies internalState, *olddelta, errno@*/; | |
628 | ||
629 | extern int | |
630 | getitimer (int which, /*@out@*/ struct itimerval *value) | |
631 | /*@modifies errno, *value*/; | |
632 | ||
633 | extern int | |
634 | gettimeofday (/*@null@*/ /*@out@*/ struct timeval *tp, /*@null@*/ /*@out@*/ struct timezone *tzp) | |
635 | /*@modifies *tp, *tzp, errno@*/; | |
636 | ||
637 | extern int | |
638 | setitimer (int which, struct itimerval *val, /*@null@*/ /*@out@*/ struct itimerval *oval) | |
639 | /*@modifies *oval, errno, internalState*/; | |
640 | ||
641 | extern int | |
642 | settimeofday (const struct timeval *t, const struct timezone *z) | |
643 | /*@modifies internalState, errno@*/; | |
644 | ||
645 | extern int | |
646 | utimes (const char *file, /*@null@*/ const struct timeval *times) | |
647 | /*@modifies fileSystem, errno*/; | |
648 | ||
649 | /*________________________________________________________________________ | |
650 | * sys/mman.h | |
651 | */ | |
652 | ||
653 | /*@constant int PROT_READ@*/ | |
654 | /*@constant int PROT_WRITE@*/ | |
655 | /*@constant int PROT_EXEC@*/ | |
656 | /*@constant int MAP_SHARED@*/ | |
657 | /*@constant int MAP_PRIVATE@*/ | |
658 | /*@constant int MAP_COPY@*/ | |
659 | /*@constant int MAP_FIXED@*/ | |
660 | /*@constant int MAP_RENAME@*/ | |
661 | /*@constant int MAP_NORESERVE@*/ | |
662 | /*@constant int MAP_INHERIT@*/ | |
663 | /*@constant int MAP_NOEXTEND@*/ | |
664 | /*@constant int MAP_HASSEMAPHORE@*/ | |
665 | /*@constant int MS_ASYNC@*/ | |
666 | /*@constant int MS_INVALIDATE@*/ | |
667 | /*@constant int MAP_FILE@*/ | |
668 | /*@constant int MAP_ANON@*/ | |
669 | /*@constant int MADV_NORMAL@*/ | |
670 | /*@constant int MADV_RANDOM@*/ | |
671 | /*@constant int MADV_SEQUENTIAL@*/ | |
672 | /*@constant int MADV_WILLNEED@*/ | |
673 | /*@constant int MADV_DONTNEED@*/ | |
674 | ||
675 | extern caddr_t | |
676 | mmap (/*@null@*/ /*@returned@*/ caddr_t addr, size_t len, int prot, int flags, int fd, off_t offset) | |
677 | /*@modifies addr@*/; | |
678 | ||
679 | extern int | |
680 | madvise (caddr_t addr, int len, int behav) | |
681 | /*@*/; | |
682 | ||
683 | extern int | |
684 | mprotect (caddr_t addr, int len, int prot) | |
685 | /*@*/; | |
686 | ||
687 | extern int | |
688 | munmap (caddr_t addr, size_t len) | |
689 | /*@*/; | |
690 | ||
691 | extern int | |
692 | msync (caddr_t addr, int len, int flags) | |
693 | /*@*/; | |
694 | ||
695 | extern int | |
696 | mlock (caddr_t addr, size_t len) | |
697 | /*@*/; | |
698 | ||
699 | extern int | |
700 | munlock (caddr_t addr, size_t len) | |
701 | /*@*/; | |
702 | ||
703 | ||
704 | /*________________________________________________________________________ | |
705 | * sys/ioctl.h | |
706 | */ | |
707 | ||
708 | struct winsize { | |
709 | unsigned short ws_row; | |
710 | unsigned short ws_col; | |
711 | unsigned short ws_xpixel; | |
712 | unsigned short ws_ypixel; | |
713 | }; | |
714 | ||
715 | /*@constant int TIOCMODG@*/ | |
716 | /*@constant int TIOCMODS@*/ | |
717 | /*@constant int TIOCM_LE@*/ | |
718 | /*@constant int TIOCM_DTR@*/ | |
719 | /*@constant int TIOCM_RTS@*/ | |
720 | /*@constant int TIOCM_ST@*/ | |
721 | /*@constant int TIOCM_SR@*/ | |
722 | /*@constant int TIOCM_CTS@*/ | |
723 | /*@constant int TIOCM_CAR@*/ | |
724 | /*@constant int TIOCM_CD@*/ | |
725 | /*@constant int TIOCM_RNG@*/ | |
726 | /*@constant int TIOCM_RI@*/ | |
727 | /*@constant int TIOCM_DSR@*/ | |
728 | /*@constant int TIOCEXCL@*/ | |
729 | /*@constant int TIOCNXCL@*/ | |
730 | /*@constant int TIOCFLUSH@*/ | |
731 | /*@constant int TIOCGETA@*/ | |
732 | /*@constant int TIOCSETA@*/ | |
733 | /*@constant int TIOCSETAW@*/ | |
734 | /*@constant int TIOCSETAF@*/ | |
735 | /*@constant int TIOCGETD@*/ | |
736 | /*@constant int TIOCSETD@*/ | |
737 | /*@constant int TIOCSBRK@*/ | |
738 | /*@constant int TIOCCBRK@*/ | |
739 | /*@constant int TIOCSDTR@*/ | |
740 | /*@constant int TIOCCDTR@*/ | |
741 | /*@constant int TIOCGPGRP@*/ | |
742 | /*@constant int TIOCSPGRP@*/ | |
743 | /*@constant int TIOCOUTQ@*/ | |
744 | /*@constant int TIOCSTI@*/ | |
745 | /*@constant int TIOCNOTTY@*/ | |
746 | /*@constant int TIOCPKT@*/ | |
747 | /*@constant int TIOCPKT_DATA@*/ | |
748 | /*@constant int TIOCPKT_FLUSHREAD@*/ | |
749 | /*@constant int TIOCPKT_FLUSHWRITE@*/ | |
750 | /*@constant int TIOCPKT_STOP@*/ | |
751 | /*@constant int TIOCPKT_START@*/ | |
752 | /*@constant int TIOCPKT_NOSTOP@*/ | |
753 | /*@constant int TIOCPKT_DOSTOP@*/ | |
754 | /*@constant int TIOCPKT_IOCTL@*/ | |
755 | /*@constant int TIOCSTOP@*/ | |
756 | /*@constant int TIOCSTART@*/ | |
757 | /*@constant int TIOCMSET@*/ | |
758 | /*@constant int TIOCMBIS@*/ | |
759 | /*@constant int TIOCMBIC@*/ | |
760 | /*@constant int TIOCMGET@*/ | |
761 | /*@constant int TIOCREMOTE@*/ | |
762 | /*@constant int TIOCGWINSZ@*/ | |
763 | /*@constant int TIOCSWINSZ@*/ | |
764 | /*@constant int TIOCUCNTL@*/ | |
765 | /*@constant int TIOCSTAT@*/ | |
766 | /*@constant int TIOCCONS@*/ | |
767 | /*@constant int TIOCSCTTY@*/ | |
768 | /*@constant int TIOCEXT@*/ | |
769 | /*@constant int TIOCSIG@*/ | |
770 | /*@constant int TIOCDRAIN@*/ | |
771 | /*@constant int TIOCMSDTRWAIT@*/ | |
772 | /*@constant int TIOCMGDTRWAIT@*/ | |
773 | /*@constant int TIOCTIMESTAMP@*/ | |
774 | /*@constant int TIOCSDRAINWAIT@*/ | |
775 | /*@constant int TIOCGDRAINWAIT@*/ | |
776 | /*@constant int TTYDISC@*/ | |
777 | /*@constant int TABLDISC@*/ | |
778 | /*@constant int SLIPDISC@*/ | |
779 | /*@constant int PPPDISC@*/ | |
780 | ||
781 | /*@constant int MAXHOSTNAMELEN@*/ | |
782 | ||
783 | extern void | |
784 | FD_CLR (int n, fd_set *p) | |
785 | /*@modifies *p@*/; | |
786 | ||
787 | extern void | |
788 | FD_COPY (fd_set *f, /*@out@*/ fd_set *t) | |
789 | /*@modifies *t@*/; | |
790 | ||
791 | extern int /*@alt lltX_bool@*/ | |
792 | FD_ISSET (int n, fd_set *p) | |
793 | /*@*/; | |
794 | ||
795 | extern void | |
796 | FD_SET (int n, fd_set *p) | |
797 | /*@modifies *p@*/; | |
798 | ||
799 | extern void | |
800 | FD_ZERO (fd_set /*@out@*/ *p) | |
801 | /*@modifies *p@*/; | |
802 | ||
803 | extern int | |
804 | fchdir (int fd) | |
805 | /*@modifies internalState, errno@*/; | |
806 | ||
807 | extern int | |
808 | fchown (int fd, uid_t owner, gid_t group) | |
809 | /*@modifies errno, fileSystem@*/; | |
810 | ||
811 | extern int | |
812 | fsync (int fd) | |
813 | /*@modifies errno, fileSystem@*/; | |
814 | ||
815 | extern int | |
816 | ftruncate (int fd, off_t length) | |
817 | /*@modifies errno, fileSystem@*/; | |
818 | ||
819 | extern int | |
820 | gethostname (/*@out@*/ char *name, int namlen) | |
821 | /*@modifies *name@*/; | |
822 | ||
823 | extern int | |
824 | initgroups (const char *name, int basegid) | |
825 | /*@modifies internalState@*/; | |
826 | ||
827 | extern int | |
828 | lchown (const char *path, uid_t owner, gid_t group) | |
829 | /*@modifies errno, fileSystem@*/; | |
830 | ||
831 | extern int | |
832 | readlink (const char *path, /*@out@*/ char *buf, int size) | |
833 | /*@modifies *buf, errno@*/; | |
834 | ||
835 | extern int | |
836 | select (int mfd, fd_set /*@null@*/ *r, fd_set /*@null@*/ *w, fd_set /*@null@*/ *e, struct timeval *t) | |
837 | /*@modifies *r, *w, *e, *t, errno@*/; | |
838 | ||
839 | extern int | |
840 | setegid (gid_t egid) | |
841 | /*@modifies errno, internalState@*/; | |
842 | ||
843 | extern int | |
844 | seteuid (uid_t euid) | |
845 | /*@modifies errno, internalState@*/; | |
846 | ||
847 | extern int | |
848 | setgroups (int ngroups, const gid_t *gidset) | |
849 | /*@modifies errno, internalState@*/; | |
850 | ||
851 | extern int | |
852 | setregid (gid_t rgid, gid_t egid) | |
853 | /*@modifies errno, internalState@*/; | |
854 | ||
855 | extern int | |
856 | setreuid (gid_t ruid, gid_t euid) | |
857 | /*@modifies errno, internalState@*/; | |
858 | ||
859 | extern void | |
860 | sync (void) | |
861 | /*@modifies fileSystem@*/; | |
862 | ||
863 | extern int | |
864 | symlink (const char *path, const char *path2) | |
865 | /*@modifies fileSystem@*/; | |
866 | ||
867 | extern int | |
868 | truncate (const char *name, off_t length) | |
869 | /*@modifies errno, fileSystem@*/; | |
870 | ||
871 | /*@constant int EBADRPC@*/ | |
872 | /*@constant int ERPCMISMATCH@*/ | |
873 | /*@constant int EPROGUNAVAIL@*/ | |
874 | /*@constant int EPROGMISMATCH@*/ | |
875 | /*@constant int EPROCUNAVAIL@*/ | |
876 | /*@constant int EFTYPE@*/ | |
877 | /*@constant int EAUTH@*/ | |
878 | /*@constant int ENEEDAUTH@*/ | |
879 | /*@constant int ELAST@*/ | |
880 | ||
881 | /*________________________________________________________________________ | |
882 | * tar.h | |
883 | */ | |
884 | ||
885 | /*@unchecked@*/ extern char *TMAGIC; | |
886 | /*@constant int TMAGLEN@*/ | |
887 | /*@unchecked@*/ extern char *TVERSION; | |
888 | /*@constant int TVERSLEN@*/ | |
889 | ||
890 | /*@constant int REGTYPE@*/ | |
891 | /*@constant int AREGTYPE@*/ | |
892 | /*@constant int LNKTYPE@*/ | |
893 | /*@constant int SYMTYPE@*/ | |
894 | /*@constant int CHRTYPE@*/ | |
895 | /*@constant int BLKTYPE@*/ | |
896 | /*@constant int DIRTYPE@*/ | |
897 | /*@constant int FIFOTYPE@*/ | |
898 | /*@constant int CONTTYPE@*/ | |
899 | ||
900 | /*@constant int TSUID@*/ | |
901 | /*@constant int TSGID@*/ | |
902 | /*@constant int TSVTX@*/ | |
903 | ||
904 | /*@constant int TUREAD@*/ | |
905 | /*@constant int TUWRITE@*/ | |
906 | /*@constant int TUEXEC@*/ | |
907 | /*@constant int TGREAD@*/ | |
908 | /*@constant int TGWRITE@*/ | |
909 | /*@constant int TGEXEC@*/ | |
910 | /*@constant int TOREAD@*/ | |
911 | /*@constant int TOWRITE@*/ | |
912 | /*@constant int TOEXEC@*/ | |
913 | ||
914 | struct ipc_perm { | |
915 | uid_t uid; /* user id */ | |
916 | gid_t gid; /* group id */ | |
917 | uid_t cuid; /* creator user id */ | |
918 | gid_t cgid; /* creator group id */ | |
919 | mode_t mode; /* r/w permission */ | |
920 | ulong seq; /* slot usage sequence number */ | |
921 | key_t key; /* user specified msg/sem/shm key */ | |
922 | } ; | |
923 | ||
924 | /*@constant int IPC_R@*/ | |
925 | /*@constant int IPC_W@*/ | |
926 | /*@constant int IPC_M@*/ | |
927 | /*@constant int IPC_CREAT@*/ | |
928 | /*@constant int IPC_EXCL@*/ | |
929 | /*@constant int IPC_NOWAIT@*/ | |
930 | /*@constant key_t IPC_PRIVATE@*/ | |
931 | /*@constant int IPC_RMID@*/ | |
932 | /*@constant int IPC_SET@*/ | |
933 | /*@constant int IPC_STAT@*/ | |
934 | ||
935 | /*________________________________________________________________________ | |
936 | * sys/msg.h | |
937 | */ | |
938 | ||
939 | struct msqid_ds { | |
940 | struct ipc_perm msg_perm; /* msg queue permission bits */ | |
941 | struct msg *msg_first; /* first message in the queue */ | |
942 | struct msg *msg_last; /* last message in the queue */ | |
943 | u_long msg_cbytes; /* number of bytes in use on the queue */ | |
944 | u_long msg_qnum; /* number of msgs in the queue */ | |
945 | u_long msg_qbytes; /* max # of bytes on the queue */ | |
946 | pid_t msg_lspid; /* pid of last msgsnd() */ | |
947 | pid_t msg_lrpid; /* pid of last msgrcv() */ | |
948 | time_t msg_stime; /* time of last msgsnd() */ | |
949 | time_t msg_rtime; /* time of last msgrcv() */ | |
950 | time_t msg_ctime; /* time of last msgctl() */ | |
951 | }; | |
952 | ||
953 | struct mymesg { | |
954 | long mtype; /* message type (+ve integer) */ | |
955 | char mtext[]; /* message body */ | |
956 | }; | |
957 | ||
958 | /*@constant int MSG_NOERROR@*/ | |
959 | /*@constant int MSGMAX@*/ | |
960 | /*@constant int MSGMNB@*/ | |
961 | /*@constant int MSGMNI@*/ | |
962 | /*@constant int MSGTQL@*/ | |
963 | ||
964 | extern int | |
965 | msgctl (int id , int cmd, /*@out@*/ struct msqid_ds *buf) | |
966 | /*@modifies errno, *buf@*/; | |
967 | ||
968 | extern int | |
969 | msgget (key_t key, int flag) | |
970 | /*@modifies errno@*/; | |
971 | ||
972 | extern int | |
973 | msgrcv (int id, /*@out@*/ void *ptr, size_t nbytes, long type, int flags) | |
974 | /*@modifies errno, *ptr@*/; | |
975 | ||
976 | extern int | |
977 | msgsnd (int id, const void *ptr, size_t nbytes, int flag) | |
978 | /*@modifies errno@*/; | |
979 | ||
980 | /*________________________________________________________________________ | |
981 | * sys/sem.h | |
982 | */ | |
983 | ||
984 | struct semid_ds { | |
985 | struct ipc_perm sem_perm; | |
986 | struct sem *sem_base; | |
987 | ushort sem_nsems; | |
988 | time_t sem_otime; | |
989 | time_t sem_ctime; | |
990 | }; | |
991 | ||
992 | struct sem { | |
993 | ushort semval; | |
994 | pid_t sempid; | |
995 | ushort semncnt; | |
996 | ushort semzcnt; | |
997 | }; | |
998 | ||
999 | union semun { | |
1000 | int val; | |
1001 | struct semid_ds *buf; | |
1002 | ushort *array; | |
1003 | }; | |
1004 | ||
1005 | struct sembuf { | |
1006 | ushort sem_num; | |
1007 | short sem_op; | |
1008 | short sem_flg; | |
1009 | }; | |
1010 | ||
1011 | /*@constant int SEM_A@*/ | |
1012 | /*@constant int SEMAEM@*/ | |
1013 | /*@constant int SEMMNI@*/ | |
1014 | /*@constant int SEMMNS@*/ | |
1015 | /*@constant int SEMMNU@*/ | |
1016 | /*@constant int SEMMSL@*/ | |
1017 | /*@constant int SEMOPN@*/ | |
1018 | /*@constant int SEM_R@*/ | |
1019 | /*@constant int SEMUME@*/ | |
1020 | /*@constant int SEM_UNDO@*/ | |
1021 | /*@constant int SEMVMX@*/ | |
1022 | /*@constant int GETVAL@*/ | |
1023 | /*@constant int SETVAL@*/ | |
1024 | /*@constant int GETPID@*/ | |
1025 | /*@constant int GETNCNT@*/ | |
1026 | /*@constant int GETZCNT@*/ | |
1027 | /*@constant int GETALL@*/ | |
1028 | /*@constant int SETALL@*/ | |
1029 | ||
1030 | /*@constant int ERMID@*/ | |
1031 | ||
1032 | extern int | |
1033 | semctl (int id, int semnum, int cmd, union semun arg) | |
1034 | /*@modifies errno@*/; | |
1035 | ||
1036 | extern int | |
1037 | semget (key_t key, int nsems, int flag) | |
1038 | /*@modifies errno@*/; | |
1039 | ||
1040 | extern int | |
1041 | semop (int id, struct sembuf *semoparray, size_t nops) | |
1042 | /*@modifies errno@*/; | |
1043 | ||
1044 | /*________________________________________________________________________ | |
1045 | * sys/shm.h | |
1046 | */ | |
1047 | ||
1048 | struct shmid_ds { | |
1049 | struct ipc_perm shm_perm; | |
1050 | int shm_segsz; | |
1051 | ushort shm_lkcnt; | |
1052 | pid_t shm_lpid; | |
1053 | pid_t shm_cpid; | |
1054 | ulong shm_nattch; | |
1055 | ulong shm_cnattch; | |
1056 | time_t shm_atime; | |
1057 | time_t shm_dtime; | |
1058 | time_t shm_ctime; | |
1059 | }; | |
1060 | ||
1061 | /*@constant int SHMLBA@*/ | |
1062 | /*@constant int SHM_LOCK@*/ | |
1063 | /*@constant int SHMMAX@*/ | |
1064 | /*@constant int SHMMIN@*/ | |
1065 | /*@constant int SHMMNI@*/ | |
1066 | /*@constant int SHM_R@*/ | |
1067 | /*@constant int SHM_RDONLY@*/ | |
1068 | /*@constant int SHM_RND@*/ | |
1069 | /*@constant int SHMSEG@*/ | |
1070 | /*@constant int SHM_W@*/ | |
1071 | /*@constant int SHM_UNLOCK@*/ | |
1072 | ||
1073 | void * | |
1074 | shmat (int id, /*@null@*/ void *addr, int flag) | |
1075 | /*@modifies errno@*/; | |
1076 | ||
1077 | extern int | |
1078 | shmctl (int id, int cmd, /*@out@*/ struct shmid_ds *buf) | |
1079 | /*@modifies errno, *buf@*/; | |
1080 | ||
1081 | extern int | |
1082 | shmdt (void *addr) | |
1083 | /*@modifies errno@*/; | |
1084 | ||
1085 | extern int | |
1086 | shmget (key_t key, int size, int flag) | |
1087 | /*@modifies errno@*/; | |
1088 | ||
1089 | ||
1090 | /*________________________________________________________________________ | |
1091 | * regex.h -- intended to be POSIX 1003.2 compliant | |
1092 | */ | |
1093 | ||
1094 | typedef off_t regoff_t; | |
1095 | ||
1096 | typedef struct { | |
1097 | int re_magic; | |
1098 | size_t re_nsub; /* number of parenthesized subexpressions */ | |
1099 | char *re_endp; /* end pointer for REG_PEND */ | |
1100 | struct re_guts *re_g; /* none of your business :-) */ | |
1101 | } regex_t; | |
1102 | ||
1103 | typedef struct { | |
1104 | regoff_t rm_so; /* start of match */ | |
1105 | regoff_t rm_eo; /* end of match */ | |
1106 | } regmatch_t; | |
1107 | ||
1108 | /* regcomp() flags */ | |
1109 | /*@constant int REG_BASIC@*/ | |
1110 | /*@constant int REG_EXTENDED@*/ | |
1111 | /*@constant int REG_ICASE@*/ | |
1112 | /*@constant int REG_NOSUB@*/ | |
1113 | /*@constant int REG_NEWLINE@*/ | |
1114 | /*@constant int REG_NOSPEC@*/ | |
1115 | /*@constant int REG_PEND@*/ | |
1116 | /*@constant int REG_DUMP@*/ | |
1117 | ||
1118 | /* regerror() flags */ | |
1119 | /*@constant int REG_NOMATCH@*/ | |
1120 | /*@constant int REG_BADPAT@*/ | |
1121 | /*@constant int REG_ECOLLATE@*/ | |
1122 | /*@constant int REG_ECTYPE@*/ | |
1123 | /*@constant int REG_EESCAPE@*/ | |
1124 | /*@constant int REG_ESUBREG@*/ | |
1125 | /*@constant int REG_EBRACK@*/ | |
1126 | /*@constant int REG_EPAREN@*/ | |
1127 | /*@constant int REG_EBRACE@*/ | |
1128 | /*@constant int REG_BADBR@*/ | |
1129 | /*@constant int REG_ERANGE@*/ | |
1130 | /*@constant int REG_ESPACE@*/ | |
1131 | /*@constant int REG_BADRPT@*/ | |
1132 | /*@constant int REG_EMPTY@*/ | |
1133 | /*@constant int REG_ASSERT@*/ | |
1134 | /*@constant int REG_INVARG@*/ | |
1135 | /*@constant int REG_ATOI@*/ /* non standard */ | |
1136 | /*@constant int REG_ITOA@*/ /* non standard */ | |
1137 | ||
1138 | /* regexec() flags */ | |
1139 | /*@constant int REG_NOTBOL@*/ | |
1140 | /*@constant int REG_NOTEOL@*/ | |
1141 | /*@constant int REG_STARTEND@*/ | |
1142 | /*@constant int REG_TRACE@*/ | |
1143 | /*@constant int REG_LARGE@*/ | |
1144 | /*@constant int REG_BACKR@*/ | |
1145 | ||
1146 | extern int | |
1147 | regcomp (/*@out@*/ regex_t *preg, const char *pattern, int flags) | |
1148 | /*@modifies *preg@*/; | |
1149 | ||
1150 | extern size_t | |
1151 | regerror (int code, const regex_t *re, /*@out@*/ char *errbuf, size_t bufsize) | |
1152 | /*@modifies *errbuf@*/; | |
1153 | ||
1154 | extern int | |
1155 | regexec (const regex_t *preg, const char *s, size_t n, /*@out@*/ regmatch_t *m, int f) | |
1156 | /*@modifies *m@*/; | |
1157 | ||
1158 | extern void | |
1159 | regfree (regex_t *p) | |
1160 | /*@modifies *p@*/; | |
1161 | ||
1162 | /*________________________________________________________________________ | |
1163 | * syslog.h | |
1164 | */ | |
1165 | ||
1166 | /*@constant int LOG_EMERG@*/ | |
1167 | /*@constant int LOG_ALERT@*/ | |
1168 | /*@constant int LOG_CRIT@*/ | |
1169 | /*@constant int LOG_ERR@*/ | |
1170 | /*@constant int LOG_WARNING@*/ | |
1171 | /*@constant int LOG_NOTICE@*/ | |
1172 | /*@constant int LOG_INFO@*/ | |
1173 | /*@constant int LOG_DEBUG@*/ | |
1174 | ||
1175 | /*@constant int LOG_KERN@*/ | |
1176 | /*@constant int LOG_USER@*/ | |
1177 | /*@constant int LOG_MAIL@*/ | |
1178 | /*@constant int LOG_DAEMON@*/ | |
1179 | /*@constant int LOG_AUTH@*/ | |
1180 | /*@constant int LOG_SYSLOG@*/ | |
1181 | /*@constant int LOG_LPR@*/ | |
1182 | /*@constant int LOG_NEWS@*/ | |
1183 | /*@constant int LOG_UUCP@*/ | |
1184 | /*@constant int LOG_CRON@*/ | |
1185 | /*@constant int LOG_AUTHPRIV@*/ | |
1186 | /*@constant int LOG_FTP@*/ | |
1187 | /*@constant int LOG_LOCAL0@*/ | |
1188 | /*@constant int LOG_LOCAL1@*/ | |
1189 | /*@constant int LOG_LOCAL2@*/ | |
1190 | /*@constant int LOG_LOCAL3@*/ | |
1191 | /*@constant int LOG_LOCAL4@*/ | |
1192 | /*@constant int LOG_LOCAL5@*/ | |
1193 | /*@constant int LOG_LOCAL6@*/ | |
1194 | /*@constant int LOG_LOCAL7@*/ | |
1195 | ||
1196 | /*@constant int LOG_PID@*/ | |
1197 | /*@constant int LOG_CONS@*/ | |
1198 | /*@constant int LOG_ODELAY@*/ | |
1199 | /*@constant int LOG_NDELAY@*/ | |
1200 | /*@constant int LOG_NOWAIT@*/ | |
1201 | /*@constant int LOG_PERROR@*/ | |
1202 | ||
1203 | extern int | |
1204 | LOG_MASK (int pri) | |
1205 | /*@*/; | |
1206 | ||
1207 | extern int | |
1208 | LOG_UPTO (int pri) | |
1209 | /*@*/; | |
1210 | ||
1211 | extern void | |
1212 | closelog (void) | |
1213 | /*@modifies fileSystem@*/; | |
1214 | ||
1215 | extern void | |
1216 | openlog (const char *ident, int logopt, int facility) | |
1217 | /*@modifies fileSystem@*/; | |
1218 | ||
1219 | extern int | |
1220 | setlogmask (int maskpri) | |
1221 | /*@modifies internalState@*/; | |
1222 | ||
1223 | extern void /*@printflike@*/ | |
1224 | syslog (int priority, const char *message, ...) | |
1225 | /*@modifies fileSystem@*/; | |
1226 | ||
1227 | extern void | |
1228 | vsyslog (int priority, const char *message, va_list args) | |
1229 | /*@modifies fileSystem@*/; | |
1230 | ||
1231 | /*________________________________________________________________________ | |
1232 | * pwd.h | |
1233 | */ | |
1234 | ||
1235 | extern extern void | |
1236 | endpwent (void) | |
1237 | /*@modifies internalState@*/; | |
1238 | ||
1239 | extern /*@null@*/ struct passwd * | |
1240 | getpwent (void) | |
1241 | /*@modifies internalState@*/; | |
1242 | ||
1243 | extern int | |
1244 | setpassent (int stayopen) | |
1245 | /*@modifies internalState@*/; | |
1246 | ||
1247 | extern int | |
1248 | setpwent (void) | |
1249 | /*@modifies internalState@*/; | |
1250 | ||
1251 | /*________________________________________________________________________ | |
1252 | * grp.h | |
1253 | */ | |
1254 | ||
1255 | extern void | |
1256 | endgrent (void) | |
1257 | /*@modifies internalState@*/; | |
1258 | ||
1259 | extern /*@null@*/ struct group * | |
1260 | getgrent (void) | |
1261 | /*@modifies internalState@*/; | |
1262 | ||
1263 | extern int | |
1264 | setgrent (void) | |
1265 | /*@modifies internalState@*/; | |
1266 | ||
1267 | extern void | |
1268 | setgrfile (const char *name) | |
1269 | /*@modifies internalState@*/; | |
1270 | ||
1271 | extern int | |
1272 | setgroupent (int stayopen) | |
1273 | /*@modifies internalState@*/; | |
1274 | ||
1275 | /*________________________________________________________________________ | |
1276 | * sys/stat.h | |
1277 | */ | |
1278 | ||
1279 | /*@constant int S_ISTXT@*/ | |
1280 | /*@constant int S_IREAD@*/ | |
1281 | /*@constant int S_IWRITE@*/ | |
1282 | /*@constant int S_IEXEC@*/ | |
1283 | /*@constant int S_IFMT@*/ | |
1284 | /*@constant int S_IFIFO@*/ | |
1285 | /*@constant int S_IFCHR@*/ | |
1286 | /*@constant int S_IFDIR@*/ | |
1287 | /*@constant int S_IFBLK@*/ | |
1288 | /*@constant int S_IFREG@*/ | |
1289 | /*@constant int S_IFLNK@*/ | |
1290 | /*@constant int S_IFSOCK@*/ | |
1291 | /*@constant int S_ISVTX@*/ | |
1292 | /*@constant int S_ISVTX@*/ | |
1293 | /*@constant int SF_SETTABLE@*/ | |
1294 | /*@constant int SF_ARCHIVED@*/ | |
1295 | /*@constant int ACCESSPERMS@*/ | |
1296 | /*@constant int ALLPERMS@*/ | |
1297 | /*@constant int DEFFILEMODE@*/ | |
1298 | /*@constant int S_BLKSIZE@*/ | |
1299 | /*@constant int SF_IMMUTABLE@*/ | |
1300 | /*@constant int SF_APPEND@*/ | |
1301 | /*@constant int UF_NODUMP@*/ | |
1302 | /*@constant int UF_IMMUTABLE@*/ | |
1303 | /*@constant int UF_APPEND@*/ | |
1304 | ||
1305 | extern int /*@alt lltX_bool@*/ | |
1306 | S_ISLNK (/*@sef@*/ mode_t m) | |
1307 | /*@*/; | |
1308 | ||
1309 | extern int /*@alt lltX_bool@*/ | |
1310 | S_ISSOCK (/*@sef@*/ mode_t m) | |
1311 | /*@*/; | |
1312 | ||
1313 | extern int | |
1314 | chflags (const char *path, u_long flags) | |
1315 | /*@modifies fileSystem, errno@*/; | |
1316 | ||
1317 | extern int | |
1318 | fchflags (int fd, u_long flags) | |
1319 | /*@modifies fileSystem, errno@*/; | |
1320 | ||
1321 | extern int | |
1322 | fchmod (int fd, mode_t mode) | |
1323 | /*@modifies fileSystem, errno@*/; | |
1324 | ||
1325 | extern int | |
1326 | lstat (const char *path, /*@out@*/ struct stat *buf) | |
1327 | /*@modifies errno, *buf@*/; | |
1328 | ||
1329 | /*________________________________________________________________________ | |
1330 | * stropts.h | |
1331 | */ | |
1332 | ||
1333 | /*@constant int FMNAMESZ@*/ | |
1334 | /*@constant int MSG_BAND@*/ | |
1335 | /*@constant int MSG_HIPRI@*/ | |
1336 | /*@constant int RS_HIPRI@*/ | |
1337 | /*@constant int S_INPUT@*/ | |
1338 | /*@constant int S_RDNORM@*/ | |
1339 | /*@constant int S_RDBAND@*/ | |
1340 | /*@constant int S_BANDURG@*/ | |
1341 | /*@constant int S_HIPRI@*/ | |
1342 | /*@constant int S_OUTPUT@*/ | |
1343 | /*@constant int S_WRNORM@*/ | |
1344 | /*@constant int S_WRBAND@*/ | |
1345 | /*@constant int S_MSG@*/ | |
1346 | /*@constant int S_ERROR@*/ | |
1347 | /*@constant int S_HANGUP@*/ | |
1348 | ||
1349 | struct strbuf { | |
1350 | int maxlen; | |
1351 | int len; | |
1352 | char *buf; | |
1353 | } | |
1354 | ||
1355 | struct str_mlist { | |
1356 | char l_name[]; | |
1357 | } | |
1358 | ||
1359 | struct str_list { | |
1360 | int sl_nmods; | |
1361 | struct str_mlist *sl_modlist; | |
1362 | } | |
1363 | ||
1364 | extern int | |
1365 | getmsg (int fd, /*@out@*/ struct strbuf *c, /*@out@*/ struct strbuf *d, int *f) | |
1366 | /*@modifies *c, *d, errno@*/; | |
1367 | ||
1368 | extern int | |
1369 | getpmsg (int fd, /*@out@*/ struct strbuf *c, /*@out@*/ struct strbuf *d, int *b, int *f) | |
1370 | /*@modifies *b, *c, *d, errno@*/; | |
1371 | ||
1372 | extern int | |
1373 | putmsg (int fd, const struct strbuf *c, const struct strbuf *d, int *f) | |
1374 | /*@modifies internalState, errno@*/; | |
1375 | ||
1376 | extern int | |
1377 | putpmsg (int fd, const struct strbuf *c, const struct strbuf *d, int b, int *f) | |
1378 | /*@modifies internalState, errno@*/; | |
1379 | ||
1380 | /*________________________________________________________________________ | |
1381 | * sys/resource.h | |
1382 | */ | |
1383 | ||
1384 | /*@constant int RLIMIT_CPU@*/ | |
1385 | /*@constant int RLIMIT_FSIZE@*/ | |
1386 | /*@constant int RLIMIT_DATA@*/ | |
1387 | /*@constant int RLIMIT_STACK@*/ | |
1388 | /*@constant int RLIMIT_CORE@*/ | |
1389 | /*@constant int RLIMIT_RSS@*/ | |
1390 | /*@constant int RLIMIT_MEMLOCK@*/ | |
1391 | /*@constant int RLIMIT_NPROC@*/ | |
1392 | /*@constant int RLIMIT_NOFILE@*/ | |
1393 | /*@constant int RLIM_NLIMITS@*/ | |
1394 | /*@constant int RLIM_INFINITY@*/ | |
1395 | /*@constant int PRIO_MIN@*/ | |
1396 | /*@constant int PRIO_MAX@*/ | |
1397 | /*@constant int PRIO_PROCESS@*/ | |
1398 | /*@constant int PRIO_PGRP@*/ | |
1399 | /*@constant int PRIO_USER@*/ | |
1400 | /*@constant int RUSAGE_SELF@*/ | |
1401 | /*@constant int RUSAGE_CHILDREN@*/ | |
1402 | ||
1403 | struct rusage { | |
1404 | struct timeval ru_utime; /* user time used */ | |
1405 | struct timeval ru_stime; /* system time used */ | |
1406 | long ru_maxrss; /* max resident set size */ | |
1407 | long ru_ixrss; /* integral shared memory size */ | |
1408 | long ru_idrss; /* integral unshared data " */ | |
1409 | long ru_isrss; /* integral unshared stack " */ | |
1410 | long ru_minflt; /* page reclaims */ | |
1411 | long ru_majflt; /* page faults */ | |
1412 | long ru_nswap; /* swaps */ | |
1413 | long ru_inblock; /* block input operations */ | |
1414 | long ru_oublock; /* block output operations */ | |
1415 | long ru_msgsnd; /* messages sent */ | |
1416 | long ru_msgrcv; /* messages received */ | |
1417 | long ru_nsignals; /* signals received */ | |
1418 | long ru_nvcsw; /* voluntary context switches */ | |
1419 | long ru_nivcsw; /* involuntary " */ | |
1420 | }; | |
1421 | ||
1422 | struct rlimit { | |
1423 | long rlim_cur; | |
1424 | long rlim_max; | |
1425 | }; | |
1426 | ||
1427 | struct loadavg { | |
1428 | unsigned long ldavg[3]; | |
1429 | long fscale; | |
1430 | }; | |
1431 | ||
1432 | extern int | |
1433 | getpriority (int which, int who) | |
1434 | /*@modifies errno@*/; | |
1435 | ||
1436 | extern int | |
1437 | getrlimit (int res, /*@out@*/ struct rlimit *rlp) | |
1438 | /*@modifies *rlp, errno@*/; | |
1439 | ||
1440 | extern int | |
1441 | getrusage (int who, /*@out@*/ struct rusage *rusage) | |
1442 | /*@modifies *rusage, errno@*/; | |
1443 | ||
1444 | extern int | |
1445 | setpriority (int which, int who, int prio) | |
1446 | /*@modifies errno, internalState@*/; | |
1447 | ||
1448 | extern int | |
1449 | setrlimit (int resource, const struct rlimit *rlp) | |
1450 | /*@modifies errno, internalState@*/; | |
1451 |