X-Git-Url: http://andersk.mit.edu/gitweb/splint.git/blobdiff_plain/d5047b9135351b2240dbe50c224bd95cf3fe5d64..210066f9dd04de7d7d2f04d320b39a52f28b290b:/lib/unix.h diff --git a/lib/unix.h b/lib/unix.h index 00e01fc..0cba8d8 100644 --- a/lib/unix.h +++ b/lib/unix.h @@ -60,7 +60,7 @@ typedef /*@integraltype@*/ clockid_t; extern void bcopy (char *b1, /*@out@*/ char *b2, int length) /*@modifies *b2@*/ ; /* Yes, the second parameter is the out param! */ -extern int /*@alt lltX_bool@*/ bcmp (char *b1, char *b2, int length) /*@*/ ; +extern int /*@alt _Bool@*/ bcmp (char *b1, char *b2, int length) /*@*/ ; /* Return value is NOT like strcmp! */ extern void bzero (/*@out@*/ char *b1, int length) /*@modifies *b1@*/ ; @@ -105,10 +105,13 @@ extern /*@null@*/ /*@dependent@*/ char * extern /*@null@*/ /*@dependent@*/ char * rindex (/*@returned@*/ char *s, char c) /*@*/ ; +# if 0 +These are in ISO C99. Moved to standard.h: + extern double cbrt (double x) /*@modifies errno@*/ ; + extern double rint (double x) /*@*/ ; + extern double trunc (double x) /*@*/ ; +# endif -extern double cbrt (double x) /*@modifies errno@*/ ; -extern double rint (double x) /*@*/ ; -extern double trunc (double x) /*@*/ ; /*@constant int ENOTBLK@*/ /*@constant int ETXTBSY@*/ @@ -261,7 +264,6 @@ typedef char *addr_t; typedef long physadr_t; typedef short cnt_t; typedef int chan_t; -typedef unsigned long rlim_t; typedef int paddr_t; typedef void *mid_t; typedef char slab_t[12]; @@ -290,22 +292,24 @@ int ioctl (int d, int /*@alt long@*/ request, /*@out@*/ void *arg) pid_t vfork (void) /*@modifies fileSystem@*/ ; +/* +** sys/uio.h +*/ struct iovec { - void *iov_base; - size_t iov_len; + /*@dependent@*/ void *iov_base; + size_t iov_len; /*: maxSet(iov_base) = iov_len */ }; +/* from limits.h */ /*@constant int UIO_MAXIOV@*/ /* BSD */ /*@constant int IOV_MAX@*/ /* supposedly SVR4 */ - extern ssize_t -readv (int fd, const struct iovec iov[], int iovcnt) - /*@modifies iov[].iov_base, fileSystem, errno@*/; +ssize_t readv (int fd, const struct iovec *iov, int iovcnt) + /*@modifies iov->iov_base, fileSystem, errno@*/; - extern ssize_t -writev (int fd, const struct iovec iov[], int iovcnt) - /*@modifies errno@*/; +ssize_t writev (int fd, const struct iovec *iov, int iovcnt) + /*@modifies errno@*/; /*________________________________________________________________________ * poll.h @@ -343,34 +347,34 @@ extern void free (/*@notnull@*/ /*@out@*/ /*@only@*/ void *p) /*@modifies *p@*/ * sys/socket.h */ -/*@constant int SOCK_STREAM@*/ -/*@constant int SOCK_DGRAM@*/ -/*@constant int SOCK_RAW@*/ + + + /*@constant int SOCK_RDM@*/ -/*@constant int SOCK_SEQPACKET@*/ -/*@constant int SO_DEBUG@*/ -/*@constant int SO_ACCEPTCONN@*/ -/*@constant int SO_REUSEADDR@*/ -/*@constant int SO_KEEPALIVE@*/ -/*@constant int SO_DONTROUTE@*/ -/*@constant int SO_BROADCAST@*/ + + + + + + + /*@constant int SO_USELOOPBACK@*/ -/*@constant int SO_LINGER@*/ -/*@constant int SO_OOBINLINE@*/ + + /*@constant int SO_REUSEPORT@*/ -/*@constant int SO_SNDBUF@*/ -/*@constant int SO_RCVBUF@*/ -/*@constant int SO_SNDLOWAT@*/ -/*@constant int SO_RCVLOWAT@*/ -/*@constant int SO_SNDTIMEO@*/ -/*@constant int SO_RCVTIMEO@*/ -/*@constant int SO_ERROR@*/ -/*@constant int SO_TYPE@*/ -/*@constant int SOL_SOCKET@*/ -/*@constant int AF_UNSPEC@*/ + + + + + + + + + + /*@constant int AF_LOCAL@*/ -/*@constant int AF_UNIX@*/ -/*@constant int AF_INET@*/ + + /*@constant int AF_IMPLINK@*/ /*@constant int AF_PUP@*/ /*@constant int AF_CHAOS@*/ @@ -398,13 +402,12 @@ extern void free (/*@notnull@*/ /*@out@*/ /*@only@*/ void *p) /*@modifies *p@*/ /*@constant int AF_ISDN@*/ /*@constant int AF_E164@*/ /*@constant int AF_MAX@*/ -/*@constant int MSG_OOB@*/ -/*@constant int MSG_PEEK@*/ -/*@constant int MSG_DONTROUTE@*/ -/*@constant int MSG_EOR@*/ -/*@constant int MSG_TRUNC@*/ -/*@constant int MSG_CTRUNC@*/ -/*@constant int MSG_WAITALL@*/ + + + + + + /*@constant int MSG_DONTWAIT@*/ /*@constant int MSG_EOF@*/ /*@constant int MSG_COMPAT@*/ @@ -443,58 +446,122 @@ extern void free (/*@notnull@*/ /*@out@*/ /*@only@*/ void *p) /*@modifies *p@*/ /*@constant int NET_RT_FLAGS@*/ /*@constant int NET_RT_IFLIST@*/ /*@constant int NET_RT_MAXID@*/ -/*@constant int SOMAXCONN@*/ -/*@constant int SCM_RIGHTS@*/ - struct sockaddr { - u_char sa_len; /* total length */ - u_char sa_family; /* address family */ - char sa_data[14]; /* actually longer; address value */ -}; +/*moved this to before socket.h to get splint to parse the header*/ +typedef /*@unsignedintegraltype@*/ sa_family_t; - struct linger { - int l_onoff; /* option on/off */ - int l_linger; /* linger time */ -}; +/* +** sys/socket.h +** (updated 26 May 2002) +*/ + +typedef /*@unsignedintegraltype@*/ __socklen_t; /* not in USB, but needed by linux */ +typedef /*@unsignedintegraltype@*/ socklen_t; - struct sockproto { - u_short sp_family; /* address family */ - u_short sp_protocol; /* protocol */ +struct sockaddr { + sa_family_t sa_family; /* address family */ + char sa_data[]; /* variable length */ }; - struct msghdr { - caddr_t msg_name; /* optional address */ - u_int msg_namelen; /* size of address */ - struct iovec *msg_iov; /* scatter/gather array */ - u_int msg_iovlen; /* # elements in msg_iov */ - caddr_t msg_control; /* ancillary data, see below */ - u_int msg_controllen; /* ancillary data buffer len */ - int msg_flags; /* flags on received message */ + +struct sockaddr_storage { + sa_family_t ss_family; +} ; + +struct msghdr { + /*@dependent@*/ void *msg_name; + socklen_t msg_namelen; /*: maxSet (msg_name) >= msg_namelen */ + /*@dependent@*/ struct iovec *msg_iov; /* scatter/gather array */ + int msg_iovlen; /* # elements in msg_iov */ /*: maxSet (msg_iov) >= msg_iovlen */ + /*@dependent@*/ void *msg_control; /* ancillary data, see below */ + socklen_t msg_controllen; /*: maxSet (msg_control) >= msg_controllen */ + int msg_flags; /* flags on received message */ +} ; + +struct cmsghdr { + socklen_t cmsg_len; /* data byte count, including hdr */ + int cmsg_level; /* originating protocol */ + int cmsg_type; /* protocol-specific type */ +} ; + +/*@constant int SCM_RIGHTS@*/ + +/*@exposed@*/ unsigned char *CMSG_DATA (/*@sef@*/ struct cmsghdr *) /*@*/ ; +/*@null@*/ /*@exposed@*/ struct cmsghdr *CMSG_NXTHDR (struct msghdr *, struct cmsghdr *) /*@*/ ; +/*@null@*/ /*@exposed@*/ struct cmsghdr *CMSG_FIRSTHDR (struct msghdr *) /*@*/ ; + +struct linger { + int l_onoff; + int l_linger; }; - struct cmsghdr { - u_int cmsg_len; /* data byte count, including hdr */ - int cmsg_level; /* originating protocol */ - int cmsg_type; /* protocol-specific type */ -/* followed by u_char cmsg_data[]; */ +/*@constant int SOCK_DGRAM@*/ +/*@constant int SOCK_RAW@*/ +/*@constant int SOCK_SEQPACKET@*/ +/*@constant int SOCK_STREAM@*/ + +/*@constant int SOL_SOCKET@*/ + +/*@constant int SO_ACCEPTCONN@*/ +/*@constant int SO_BROADCAST@*/ +/*@constant int SO_DEBUG@*/ +/*@constant int SO_DONTROUTE@*/ +/*@constant int SO_ERROR@*/ +/*@constant int SO_KEEPALIVE@*/ +/*@constant int SO_LINGER@*/ +/*@constant int SO_OOBINLINE@*/ +/*@constant int SO_RCVBUF@*/ +/*@constant int SO_RCVLOWAT@*/ +/*@constant int SO_RCVTIMEO@*/ +/*@constant int SO_REUSEADDR@*/ +/*@constant int SO_SNDBUF@*/ +/*@constant int SO_SNDLOWAT@*/ +/*@constant int SO_SNDTIMEO@*/ +/*@constant int SO_TYPE@*/ + +/*@constant int SOMAXCONN@*/ + +/*@constant int MSG_CTRUNC@*/ +/*@constant int MSG_DONTROUTE@*/ +/*@constant int MSG_EOR@*/ +/*@constant int MSG_OOB@*/ +/*@constant int MSG_PEEK@*/ +/*@constant int MSG_TRUNC@*/ +/*@constant int MSG_WAITALL@*/ + +/*@constant int AF_INET@*/ +/*@constant int AF_INET6@*/ +/*@constant int AF_UNIX@*/ +/*@constant int AF_UNSPEC@*/ + +/*@constant int SHUT_RD@*/ +/*@constant int SHUT_RDWR@*/ +/*@constant int SHUT_WR@*/ + +# if 0 +/* +** These were in the old unix.h spec, but are not in SUS6 +*/ + +struct sockproto { + u_short sp_family; /* address family */ + u_short sp_protocol; /* protocol */ }; - extern int -accept (int s, struct sockaddr *addr, int *addrlen) - /*@modifies *addrlen, errno@*/; +# endif - extern int -bind (int s, struct sockaddr *name, int namelen) - /*@modifies errno, fileSystem@*/; +int accept (int s, struct sockaddr *addr, int *addrlen) + /*@modifies *addrlen, errno@*/; - extern int -connect (int s, struct sockaddr *name, int namelen) - /*@modifies errno, internalState@*/; +int bind (int s, const struct sockaddr *name, int namelen) + /*@modifies errno, fileSystem@*/; -int getpeername (int s, /*@out@*/ struct sockaddr *name, size_t *namelen) - /*@modifies *name, *namelen, errno@*/; - - typedef /*@unsignedintegraltype@*/ socklen_t; +int connect (int s, const struct sockaddr *name, int namelen) + /*@modifies errno, internalState@*/; +int getpeername (int s, /*@out@*/ struct sockaddr */*restrict*/ name, socklen_t */*restrict*/ namelen) + /*drl splint doesn't handle restrict yet*/ + /*@modifies *name, *namelen, errno@*/; + #ifdef STRICT int getsockname (int s, /*@out@*/ struct sockaddr *address, socklen_t *address_len) @@ -813,41 +880,17 @@ munlock (caddr_t addr, size_t len) /*@constant int MAXHOSTNAMELEN@*/ - extern void -FD_CLR (int n, fd_set *p) - /*@modifies *p@*/; - - extern void -FD_COPY (fd_set *f, /*@out@*/ fd_set *t) - /*@modifies *t@*/; - - extern int /*@alt lltX_bool@*/ -FD_ISSET (int n, fd_set *p) - /*@*/; - - extern void -FD_SET (int n, fd_set *p) - /*@modifies *p@*/; - - extern void -FD_ZERO (fd_set /*@out@*/ *p) - /*@modifies *p@*/; - - extern int -fchdir (int fd) - /*@modifies internalState, errno@*/; +extern void FD_CLR (/*@sef@*/ int n, /*@sef@*/ fd_set *p) /*@modifies *p@*/ ; +extern void FD_COPY (/*@sef@*/ fd_set *f, /*@out@*/ fd_set *t) /*@modifies *t@*/ ; +extern int /*@alt _Bool@*/ FD_ISSET (/*@sef@*/ int n, /*@sef@*/ fd_set *p) /*@*/ ; +extern void FD_SET (/*@sef@*/ int n, /*@sef@*/ fd_set *p) /*@modifies *p@*/ ; +extern void FD_ZERO (/*@sef@*/ fd_set /*@out@*/ *p) /*@modifies *p@*/; - extern int -fchown (int fd, uid_t owner, gid_t group) - /*@modifies errno, fileSystem@*/; +extern int fchdir (int fd) /*@modifies internalState, errno@*/; +extern int fchown (int fd, uid_t owner, gid_t group) /*@modifies errno, fileSystem@*/; +extern int fsync (int fd) /*@modifies errno, fileSystem@*/; - extern int -fsync (int fd) - /*@modifies errno, fileSystem@*/; - - extern int -ftruncate (int fd, off_t length) - /*@modifies errno, fileSystem@*/; +extern int ftruncate (int fd, off_t length) /*@modifies errno, fileSystem@*/; int gethostname (/*@out@*/ char *address, size_t address_len) /*:errorstatus@*/ @@ -856,46 +899,38 @@ int gethostname (/*@out@*/ char *address, size_t address_len) int initgroups (const char *name, int basegid) /*@modifies internalState@*/; - extern int -lchown (const char *path, uid_t owner, gid_t group) - /*@modifies errno, fileSystem@*/; - - extern int -select (int mfd, fd_set /*@null@*/ *r, fd_set /*@null@*/ *w, fd_set /*@null@*/ *e, struct timeval *t) - /*@modifies *r, *w, *e, *t, errno@*/; - - extern int -setegid (gid_t egid) - /*@modifies errno, internalState@*/; - - extern int -seteuid (uid_t euid) - /*@modifies errno, internalState@*/; - - extern int -setgroups (int ngroups, const gid_t *gidset) - /*@modifies errno, internalState@*/; - - extern int -setregid (gid_t rgid, gid_t egid) - /*@modifies errno, internalState@*/; - - extern int -setreuid (gid_t ruid, gid_t euid) - /*@modifies errno, internalState@*/; - - extern void -sync (void) - /*@modifies fileSystem@*/; +int lchown (const char *path, uid_t owner, gid_t group) + /*@modifies errno, fileSystem@*/; + +int select (int mfd, fd_set /*@null@*/ *r, fd_set /*@null@*/ *w, + fd_set /*@null@*/ *e, /*@null@*/ struct timeval *t) + /*@modifies *r, *w, *e, *t, errno@*/; + /* evans - 2002-05-26: added null for t, bug reported by Enrico Scholz */ - extern int -symlink (const char *path, const char *path2) - /*@modifies fileSystem@*/; - - extern int -truncate (const char *name, off_t length) - /*@modifies errno, fileSystem@*/; +int setegid (gid_t egid) + /*@modifies errno, internalState@*/; +int seteuid (uid_t euid) + /*@modifies errno, internalState@*/; + +int setgroups (int ngroups, const gid_t *gidset) + /*@modifies errno, internalState@*/; + +int setregid (gid_t rgid, gid_t egid) + /*@modifies errno, internalState@*/; + +int setreuid (gid_t ruid, gid_t euid) + /*@modifies errno, internalState@*/; + +void sync (void) + /*@modifies fileSystem@*/; + +int symlink (const char *path, const char *path2) + /*@modifies fileSystem@*/; + +int truncate (const char *name, off_t length) + /*@modifies errno, fileSystem@*/; + /*@constant int EBADRPC@*/ /*@constant int ERPCMISMATCH@*/ /*@constant int EPROGUNAVAIL@*/ @@ -1110,153 +1145,11 @@ extern int shmdt (void *addr) extern int shmget (key_t key, int size, int flag) /*@modifies errno@*/ ; -# if 0 - /* - ** this is in stdio.h! - */ /* -** stdio.h +** stdio.h - in separte file stdio.h */ -/* -** evans 2001-12-30: added from http://www.opengroup.org/onlinepubs/007908799/xsh/stdio.h.html -*/ - -/*@constant unsignedintegraltype BUFSIZ@*/ -/*@constant unsignedintegraltype FILENAME_MAX@*/ -/*@constant unsignedintegraltype FOPEN_MAX@*/ -/*@constant bool _IOFBF@*/ -/*@constant bool _IOLBF@*/ -/*@constant bool _IONBF@*/ -/*@constant unsignedintegraltype L_ctermid@*/ -/*@constant unsignedintegraltype L_cuserid@*/ -/*@constant unsignedintegraltype L_tmpnam@*/ -/*@constant unsignedintegraltype SEEK_CUR@*/ -/*@constant unsignedintegraltype SEEK_END@*/ -/*@constant unsignedintegraltype SEEK_SET@*/ -/*@constant unsignedintegraltype TMP_MAX@*/ - -/* EOF */ -/* NULL */ - -/*@constant observer char *P_tmpdir@*/ - -void clearerr (FILE *s) - /*@modifies s@*/ ; - -/*@dependent@*/ char *ctermid (/*@returned@*/ /*@null@*/ char *) /*@*/ ; - /* Result may be static pointer if parameter is NULL, otherwise is fresh. */ - -char *cuserid (/*@null@*/ /*@returned@*/ char *) - /*@warn legacy "cuserid is obsolete"@*/ /*@*/ ; - -/* fclose in standard.h */ - -/*@null@*/ FILE *fdopen (int, const char *) - /*@modifies errno, fileSystem@*/ ; - -/* feof, ferror fflush, fgetc, fgetpos, fgets - in standard.h */ - -int fileno (/*@notnull@*/ FILE *) - /*:errorcode -1:*/ - /*@modifies errno@*/ ; - -void flockfile (/*@notnull@*/ FILE *f) - /*@modifies f, fileSystem@*/ ; - -int fseeko (FILE *stream, off_t offset, int whence) - /*:errorcode -1:*/ - /*@modifies stream, errno@*/ ; - -off_t ftello(FILE *stream) - /*:errorcode -1:*/ /*@modifies errno*/ ; - -int ftrylockfile(FILE *stream) - /*:errorcode !0:*/ - /*@modifies stream, fileSystem, errno*/ ; - -void funlockfile (FILE *stream) - /*@modifies stream, fileSystem*/ ; - -int getc_unlocked(FILE *stream) - /*@warn multithreaded "getc_unlocked is a thread unsafe version of getc"@*/ - /*@modifies *stream, fileSystem, errno@*/ ; - -int getchar_unlocked (void) - /*@warn multithreaded "getchar_unlocked is a thread unsafe version of getchar"@*/ - /*@globals stdin@*/ - /*@modifies *stdin, fileSystem@*/ ; - -int getopt (int, char * const[], const char) - /*@warn legacy@*/ ; - -int getw (FILE *stream) - /*:errorcode EOF:*/ - /*@modifies fileSystem, *stream, errno@*/ ; - -int pclose(FILE *stream) - /*:errorcode -1:*/ - /*@modifies *stream, errno@*/ ; - -/*@null@*/ FILE *popen (const char *command, const char *mode) - /*:errorcode NULL:*/ - /*@modifies fileSystem, errno@*/ ; - -int putc_unlocked (int, FILE *stream) - /*@warn multithreaded "putc_unlocked is a thread unsafe version of putc"@*/ - /*:errorcode EOF:*/ - /*@modifies fileSystem, *stream, errno@*/ ; - -int putchar_unlocked(int) - /*@warn multithreaded "putchar_unlocked is a thread unsafe version of putchar"@*/ - /*:errorcode EOF:*/ - /*@modifies fileSystem, *stdout, errno@*/ ; - -int putw(int, FILE *stream) - /*:errorcode EOF:*/ - /*@modifies fileSystem, *stdout, errno@*/ ; - -int remove (const char *) - /*@modifies fileSystem@*/ ; - -int rename (const char *, const char *) - /*@modifies fileSystem@*/ ; - -void rewind (FILE *stream) - /*@modifies *stream@*/ ; - -void setbuf (FILE *stream, /*@null@*/ /*@dependent@*/ /*@exposed@*/ char *buf) - /*@modifies stream@*/ - -int setvbuf (FILE *stream, /*@null@*/ /*@dependent@*/ /*@exposed@*/ char *buf, int type, size_t size) - /*@modifies stream@*/ - /*:errorcode !0:*/ ; - -int snprintf (char *s, size_t n, const char *format, ...); - - int sprintf(char *, const char *, ...); - int sscanf(const char *, const char *, int ...); - char *tempnam(const char *, const char *); - FILE *tmpfile(void); - char *tmpnam(char *); - int ungetc(int, FILE *); - int vfprintf(FILE *, const char *, va_list); - int vprintf(const char *, va_list); - int vsnprintf(char *, size_t, const char *, va_list); - int vsprintf(char *, const char *, va_list); - - - The following external variables are defined: - - - extern char *optarg; ) - extern int opterr; ) - extern int optind; ) (LEGACY) - extern int optopt; ) - -# endif - /* ** syslog.h */ @@ -1339,29 +1232,20 @@ setpassent (int stayopen) setpwent (void) /*@modifies internalState@*/; -/*________________________________________________________________________ - * grp.h - */ +/* +** grp.h +*/ - extern void -endgrent (void) - /*@modifies internalState@*/; +void endgrent (void) /*@modifies internalState@*/; - extern /*@null@*/ struct group * -getgrent (void) - /*@modifies internalState@*/; +/*@null@*/ /*@observer@*/ struct group *getgrent (void) + /*@modifies internalState@*/; - extern int -setgrent (void) - /*@modifies internalState@*/; +int setgrent (void) /*@modifies internalState@*/; - extern void -setgrfile (const char *name) - /*@modifies internalState@*/; +void setgrfile (const char *name) /*@modifies internalState@*/; - extern int -setgroupent (int stayopen) - /*@modifies internalState@*/; +int setgroupent (int stayopen) /*@modifies internalState@*/; /* ** sys/stat.h @@ -1437,16 +1321,16 @@ struct stat { /*@constant int UF_APPEND@*/ # endif -int /*@alt lltX_bool@*/ S_ISBLK (/*@sef@*/ mode_t m) /*@*/; -int /*@alt lltX_bool@*/ S_ISCHR (/*@sef@*/ mode_t m) /*@*/; -int /*@alt lltX_bool@*/ S_ISDIR (/*@sef@*/ mode_t m) /*@*/; -int /*@alt lltX_bool@*/ S_ISFIFO (/*@sef@*/ mode_t m) /*@*/; -int /*@alt lltX_bool@*/ S_ISREG (/*@sef@*/ mode_t m) /*@*/; -int /*@alt lltX_bool@*/ S_ISLNK (/*@sef@*/ mode_t m) /*@*/; +int /*@alt _Bool@*/ S_ISBLK (/*@sef@*/ __mode_t m) /*@*/; +int /*@alt _Bool@*/ S_ISCHR (/*@sef@*/ __mode_t m) /*@*/; +int /*@alt _Bool@*/ S_ISDIR (/*@sef@*/ __mode_t m) /*@*/; +int /*@alt _Bool@*/ S_ISFIFO (/*@sef@*/ __mode_t m) /*@*/; +int /*@alt _Bool@*/ S_ISREG (/*@sef@*/ __mode_t m) /*@*/; +int /*@alt _Bool@*/ S_ISLNK (/*@sef@*/ __mode_t m) /*@*/; -int /*@alt lltX_bool@*/ S_TYPEISMQ (/*@sef@*/ struct stat *buf) /*@*/ ; -int /*@alt lltX_bool@*/ S_TYPEISSEM (/*@sef@*/ struct stat *buf) /*@*/ ; -int /*@alt lltX_bool@*/ S_TYPEISSHM (/*@sef@*/ struct stat *buf) /*@*/ ; +int /*@alt _Bool@*/ S_TYPEISMQ (/*@sef@*/ struct stat *buf) /*@*/ ; +int /*@alt _Bool@*/ S_TYPEISSEM (/*@sef@*/ struct stat *buf) /*@*/ ; +int /*@alt _Bool@*/ S_TYPEISSHM (/*@sef@*/ struct stat *buf) /*@*/ ; /* in POSIX: chmod, fstat, mkdir, mkfifo, stat, umask */ @@ -1550,78 +1434,59 @@ putmsg (int fd, const struct strbuf *c, const struct strbuf *d, int *f) extern int putpmsg (int fd, const struct strbuf *c, const struct strbuf *d, int b, int *f) /*@modifies internalState, errno@*/; -/*________________________________________________________________________ - * sys/resource.h - */ +/* +** sys/resource.h +** +** Update 2002-07-09 from +** http://www.opengroup.org/onlinepubs/007904975/basedefs/sys/resource.h.html +*/ -/*@constant int RLIMIT_CPU@*/ -/*@constant int RLIMIT_FSIZE@*/ -/*@constant int RLIMIT_DATA@*/ -/*@constant int RLIMIT_STACK@*/ -/*@constant int RLIMIT_CORE@*/ -/*@constant int RLIMIT_RSS@*/ -/*@constant int RLIMIT_MEMLOCK@*/ -/*@constant int RLIMIT_NPROC@*/ -/*@constant int RLIMIT_NOFILE@*/ -/*@constant int RLIM_NLIMITS@*/ -/*@constant int RLIM_INFINITY@*/ -/*@constant int PRIO_MIN@*/ -/*@constant int PRIO_MAX@*/ /*@constant int PRIO_PROCESS@*/ /*@constant int PRIO_PGRP@*/ /*@constant int PRIO_USER@*/ + +typedef /*@unsignedintegraltype@*/ rlim_t; + +/*@constant rlim_t RLIM_INFINITY@*/ +/*@constant rlim_t RLIM_SAVED_MAX@*/ +/*@constant rlim_t RLIM_SAVED_CUR@*/ + /*@constant int RUSAGE_SELF@*/ /*@constant int RUSAGE_CHILDREN@*/ - struct rusage { - struct timeval ru_utime; /* user time used */ - struct timeval ru_stime; /* system time used */ - long ru_maxrss; /* max resident set size */ - long ru_ixrss; /* integral shared memory size */ - long ru_idrss; /* integral unshared data " */ - long ru_isrss; /* integral unshared stack " */ - long ru_minflt; /* page reclaims */ - long ru_majflt; /* page faults */ - long ru_nswap; /* swaps */ - long ru_inblock; /* block input operations */ - long ru_oublock; /* block output operations */ - long ru_msgsnd; /* messages sent */ - long ru_msgrcv; /* messages received */ - long ru_nsignals; /* signals received */ - long ru_nvcsw; /* voluntary context switches */ - long ru_nivcsw; /* involuntary " */ +struct rlimit { + rlim_t rlim_cur; + rlim_t rlim_max; }; - struct rlimit { - long rlim_cur; - long rlim_max; +struct rusage { + struct timeval ru_utime; /* user time used */ + struct timeval ru_stime; /* system time used */ + /* other members optional */ }; - struct loadavg { - unsigned long ldavg[3]; - long fscale; -}; - - extern int -getpriority (int which, int who) - /*@modifies errno@*/; +/*@constant int RLIMIT_CORE@*/ +/*@constant int RLIMIT_CPU@*/ +/*@constant int RLIMIT_DATA@*/ +/*@constant int RLIMIT_FSIZE@*/ +/*@constant int RLIMIT_NOFILE@*/ +/*@constant int RLIMIT_STACK@*/ +/*@constant int RLIMIT_AS@*/ - extern int -getrlimit (int res, /*@out@*/ struct rlimit *rlp) - /*@modifies *rlp, errno@*/; +int getpriority (int which, id_t who) + /*@modifies errno@*/; - extern int -getrusage (int who, /*@out@*/ struct rusage *rusage) - /*@modifies *rusage, errno@*/; +int getrlimit (int res, /*@out@*/ struct rlimit *rlp) + /*@modifies *rlp, errno@*/; - extern int -setpriority (int which, int who, int prio) - /*@modifies errno, internalState@*/; +int getrusage (int who, /*@out@*/ struct rusage *rusage) + /*@modifies *rusage, errno@*/; - extern int -setrlimit (int resource, const struct rlimit *rlp) - /*@modifies errno, internalState@*/; +int setpriority (int which, id_t who, int prio) + /*@modifies errno, internalState@*/; +int setrlimit (int resource, const struct rlimit *rlp) + /*@modifies errno, internalState@*/; /* ** in @@ -2151,13 +2016,13 @@ int fchroot (int fildes) */ # ifdef STRICT -lltX_bool isascii(int) /*@*/ ; -lltX_bool toascii(int) /*@*/ ; +_Bool isascii(int) /*@*/ ; +_Bool toascii(int) /*@*/ ; char _toupper(/*@sef@*/ int) /*@*/ ; char _tolower(/*@sef@*/ int) /*@*/ ; # else -lltX_bool /*@alt int@*/ isascii(int /*@alt unsigned char@*/) /*@*/ ; -lltX_bool /*@alt int@*/ toascii(int /*@alt unsigned char@*/); +_Bool /*@alt int@*/ isascii(int /*@alt unsigned char@*/) /*@*/ ; +_Bool /*@alt int@*/ toascii(int /*@alt unsigned char@*/); char /*@alt int@*/ _toupper(/*@sef@*/ int /*@alt unsigned char@*/); char /*@alt int@*/ _tolower(/*@sef@*/ int /*@alt unsigned char@*/); # endif @@ -2185,7 +2050,7 @@ void srand48 (long int seedval) /*@modifies internalState@*/ ; typedef /*@unsignedintegraltype@*/ in_port_t; /* An unsigned integral type of exactly 16 bits. */ typedef /*@unsignedintegraltype@*/ in_addr_t; /* An unsigned integral type of exactly 32 bits. */ -typedef /*@unsignedintegraltype@*/ sa_family_t; +/* sa_family_t moved earlier */ struct in_addr { in_addr_t s_addr;