]> andersk Git - splint.git/blobdiff - lib/unix.h
Added linux builtin type in inet.h to unix library.
[splint.git] / lib / unix.h
index 54ccec28804cc83d4a68b092428760f3105d9df8..4006d32ff3e72985ae38e9c4ca056aa26b379d90 100644 (file)
@@ -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)
@@ -856,46 +923,37 @@ 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@*/;
-
-       extern int
-symlink (const char *path, const char *path2)
-       /*@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
-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,140 +1168,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
-*/
 
 /*
-** evans 2001-12-30: added from http://www.opengroup.org/onlinepubs/007908799/xsh/stdio.h.html
+** stdio.h - in separte file stdio.h
 */
 
-/*@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@*/
-
-/*@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"@*/ /*@*/ ;
-
-/*@null@*/ FILE *fdopen (int, const char *)
-  /*@modifies errno, fileSystem@*/ ;
-
-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@*/ char *buf);
-     int      setvbuf(FILE *, char *, int, size_t);
-     int      snprintf(char *, size_t, const char *, ...);
-     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
 */
@@ -1285,33 +1214,26 @@ void setbuf (FILE *stream, /*@null@*/ char *buf);
 /*@constant int LOG_NOWAIT@*/
 /*@constant int LOG_PERROR@*/
 
-       extern int
-LOG_MASK (int pri)
-       /*@*/;
-
-       extern int
-LOG_UPTO (int pri)
-       /*@*/;
-
-       extern void
-closelog (void)
-       /*@modifies fileSystem@*/;
-
-       extern void
-openlog (const char *ident, int logopt, int facility)
-       /*@modifies fileSystem@*/;
-
-       extern int
-setlogmask (int maskpri)
-       /*@modifies internalState@*/;
-
-       extern void /*@printflike@*/
-syslog (int priority, const char *message, ...)
-       /*@modifies fileSystem@*/;
-
-       extern void
-vsyslog (int priority, const char *message, va_list args)
-       /*@modifies fileSystem@*/;
+int LOG_MASK (int pri)
+     /*@*/;
+     
+int LOG_UPTO (int pri)
+     /*@*/;
+     
+void closelog (void)
+     /*@modifies fileSystem@*/;
+     
+void openlog (const char *ident, int logopt, int facility)
+     /*@modifies fileSystem@*/;
+     
+int setlogmask (int maskpri)
+     /*@modifies internalState@*/;
+     
+void /*@printflike@*/ syslog (int priority, const char *message, ...)
+     /*@modifies fileSystem@*/;
+     
+void vsyslog (int priority, const char *message, va_list args)
+     /*@modifies fileSystem@*/;
 
 /*________________________________________________________________________
  * pwd.h
@@ -1333,29 +1255,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
@@ -1387,18 +1300,6 @@ struct stat {
 } ;
 /*@=redef@*/ /*@=matchfields@*/
 
-/*@constant mode_t S_IFMT@*/
-/*@constant mode_t S_IFBLK@*/
-/*@constant mode_t S_IFCHR@*/
-/*@constant mode_t S_IFIFO@*/
-/*@constant mode_t S_IFREG@*/
-/*@constant mode_t S_IFDIR@*/
-/*@constant mode_t S_IFLNK@*/
-
-/*@constant mode_t S_IRWXU@*/
-/*@constant mode_t S_IRUSR@*/
-
-/*@-incondefs@*/ /*: probably wrong in posix.h? */
 /*@constant mode_t S_IWUSR@*/
 /*@constant mode_t S_IXUSR@*/
 /*@constant mode_t S_IRWXG@*/
@@ -1413,8 +1314,6 @@ struct stat {
 /*@constant mode_t S_ISGID@*/
 /*@constant mode_t S_ISVTX@*/
 
-/*@=incondefs@*/
-
 # if 0
 /*These are the old definitions - they don't appear to be in the Single UNIX Specification */
 
@@ -1558,78 +1457,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 <netdb.h>
@@ -2193,7 +2073,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;
@@ -2253,8 +2133,13 @@ typedef /*@abstract@*/ DIR;
 
 int closedir (DIR *) /*:errorcode -1*/ ; 
 /*@null@*/ /*@dependent@*/ DIR *opendir(const char *)  /*@modifies errno, fileSystem@*/ ;
-struct dirent *readdir(DIR *);
-int readdir_r(DIR *, struct dirent *, struct dirent **);
+
+/* in posix.h: struct dirent *readdir(DIR *); */
+
+int readdir_r (DIR *, struct dirent *, /*@out@*/ struct dirent **result)
+     /*@modifies *result@*/
+     /*:errorcode !0:*/ ;
+
 void rewinddir(DIR *);
 void seekdir(DIR *, long int);
 long int telldir(DIR *);
This page took 0.078428 seconds and 4 git commands to generate.