Browse Source

Sync w/ glibc

Peter S. Mazinger 19 years ago
parent
commit
c72bf65f09
1 changed files with 201 additions and 95 deletions
  1. 201 95
      include/unistd.h

+ 201 - 95
include/unistd.h

@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1999, 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 1991-2002, 2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    This file is part of the GNU C Library.
 
 
    The GNU C Library is free software; you can redistribute it and/or
    The GNU C Library is free software; you can redistribute it and/or
@@ -30,34 +30,30 @@ __BEGIN_DECLS
 /* These may be used to determine what facilities are present at compile time.
 /* These may be used to determine what facilities are present at compile time.
    Their values can be obtained at run time from `sysconf'.  */
    Their values can be obtained at run time from `sysconf'.  */
 
 
-/* POSIX Standard approved as ISO/IEC 9945-1 as of August, 1988 and
+/* POSIX Standard approved as ISO/IEC 9945-1 as of December 2001.  */
-   extended by POSIX-1b (aka POSIX-4) and POSIX-1c (aka POSIX threads).  */
+#define	_POSIX_VERSION	200112L
-#define	_POSIX_VERSION	199506L
 
 
 /* These are not #ifdef __USE_POSIX2 because they are
 /* These are not #ifdef __USE_POSIX2 because they are
    in the theoretically application-owned namespace.  */
    in the theoretically application-owned namespace.  */
 
 
-/* POSIX Standard approved as ISO/IEC 9945-2 as of December, 1993.  */
-#define	_POSIX2_C_VERSION	199209L
-
 /* The utilities on GNU systems also correspond to this version.  */
 /* The utilities on GNU systems also correspond to this version.  */
-#define _POSIX2_VERSION	199209L
+#define _POSIX2_VERSION	200112L
 
 
 /* If defined, the implementation supports the
 /* If defined, the implementation supports the
    C Language Bindings Option.  */
    C Language Bindings Option.  */
-#define	_POSIX2_C_BIND	1
+#define	_POSIX2_C_BIND	200112L
 
 
 /* If defined, the implementation supports the
 /* If defined, the implementation supports the
    C Language Development Utilities Option.  */
    C Language Development Utilities Option.  */
-#define	_POSIX2_C_DEV	1
+#define	_POSIX2_C_DEV	200112L
 
 
 /* If defined, the implementation supports the
 /* If defined, the implementation supports the
    Software Development Utilities Option.  */
    Software Development Utilities Option.  */
-#define	_POSIX2_SW_DEV	1
+#define	_POSIX2_SW_DEV	200112L
 
 
 /* If defined, the implementation supports the
 /* If defined, the implementation supports the
    creation of locales with the localedef utility.  */
    creation of locales with the localedef utility.  */
-#define _POSIX2_LOCALEDEF       1
+#define _POSIX2_LOCALEDEF       200112L
 
 
 /* X/Open version number to which the library conforms.  It is selectable.  */
 /* X/Open version number to which the library conforms.  It is selectable.  */
 #ifdef __USE_UNIX98
 #ifdef __USE_UNIX98
@@ -198,7 +194,7 @@ typedef __ssize_t ssize_t;
 #define __need_NULL
 #define __need_NULL
 #include <stddef.h>
 #include <stddef.h>
 
 
-#ifdef __USE_XOPEN
+#if defined __USE_XOPEN || defined __USE_XOPEN2K
 /* The Single Unix specification says that some more types are
 /* The Single Unix specification says that some more types are
    available here.  */
    available here.  */
 # ifndef __gid_t_defined
 # ifndef __gid_t_defined
@@ -257,7 +253,14 @@ typedef __socklen_t socklen_t;
 #define	F_OK	0		/* Test for existence.  */
 #define	F_OK	0		/* Test for existence.  */
 
 
 /* Test for access to NAME using the real UID and real GID.  */
 /* Test for access to NAME using the real UID and real GID.  */
-extern int access (__const char *__name, int __type) __THROW;
+extern int access (__const char *__name, int __type) __THROW __nonnull ((1));
+
+#if 0 /* def __USE_GNU */
+/* Test for access to NAME using the effective UID and GID
+   (as normal file operations use).  */
+extern int euidaccess (__const char *__name, int __type)
+     __THROW __nonnull ((1));
+#endif
 
 
 
 
 /* Values for the WHENCE argument to lseek.  */
 /* Values for the WHENCE argument to lseek.  */
@@ -285,9 +288,8 @@ extern __off_t lseek (int __fd, __off_t __offset, int __whence) __THROW;
 #else
 #else
 # ifdef __REDIRECT
 # ifdef __REDIRECT
 extern __off64_t __REDIRECT (lseek,
 extern __off64_t __REDIRECT (lseek,
-			     (int __fd, __off64_t __offset, int __whence)
+				 (int __fd, __off64_t __offset, int __whence),
-			     __THROW,
+				 lseek64);
-			     lseek64);
 # else
 # else
 #  define lseek lseek64
 #  define lseek lseek64
 # endif
 # endif
@@ -296,31 +298,51 @@ extern __off64_t __REDIRECT (lseek,
 extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence) __THROW;
 extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence) __THROW;
 #endif
 #endif
 
 
-/* Close the file descriptor FD.  */
+/* Close the file descriptor FD.
-extern int close (int __fd) __THROW;
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int close (int __fd);
 
 
 /* Read NBYTES into BUF from FD.  Return the
 /* Read NBYTES into BUF from FD.  Return the
-   number read, -1 for errors or 0 for EOF.  */
+   number read, -1 for errors or 0 for EOF.
-extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __THROW;
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern ssize_t read (int __fd, void *__buf, size_t __nbytes);
+
+/* Write N bytes of BUF to FD.  Return the number written, or -1.
 
 
-/* Write N bytes of BUF to FD.  Return the number written, or -1.  */
+   This function is a cancellation point and therefore not marked with
-extern ssize_t write (int __fd, __const void *__buf, size_t __n) __THROW;
+   __THROW.  */
+extern ssize_t write (int __fd, __const void *__buf, size_t __n);
 
 
 #ifdef __USE_UNIX98
 #ifdef __USE_UNIX98
 # ifndef __USE_FILE_OFFSET64
 # ifndef __USE_FILE_OFFSET64
-extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset)
+/* Read NBYTES into BUF from FD at the given position OFFSET without
-     __THROW;
+   changing the file pointer.  Return the number read, -1 for errors
+   or 0 for EOF.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
+		      __off_t __offset);
+
+/* Write N bytes of BUF to FD at the given position OFFSET without
+   changing the file pointer.  Return the number written, or -1.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
 extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
 extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n,
-		       __off_t __offset) __THROW;
+		       __off_t __offset);
 # else
 # else
 #  ifdef __REDIRECT
 #  ifdef __REDIRECT
 extern ssize_t __REDIRECT (pread, (int __fd, void *__buf, size_t __nbytes,
 extern ssize_t __REDIRECT (pread, (int __fd, void *__buf, size_t __nbytes,
-				   __off64_t __offset) __THROW,
+				   __off64_t __offset),
 			   pread64);
 			   pread64);
 extern ssize_t __REDIRECT (pwrite, (int __fd, __const void *__buf,
 extern ssize_t __REDIRECT (pwrite, (int __fd, __const void *__buf,
-				    size_t __nbytes, __off64_t __offset)
+				    size_t __nbytes, __off64_t __offset),
-			   __THROW,
+			   pwrite64);
-			pwrite64);
 #  else
 #  else
 #   define pread pread64
 #   define pread pread64
 #   define pwrite pwrite64
 #   define pwrite pwrite64
@@ -332,11 +354,11 @@ extern ssize_t __REDIRECT (pwrite, (int __fd, __const void *__buf,
    changing the file pointer.  Return the number read, -1 for errors
    changing the file pointer.  Return the number read, -1 for errors
    or 0 for EOF.  */
    or 0 for EOF.  */
 extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
 extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes,
-			__off64_t __offset) __THROW;
+			__off64_t __offset);
 /* Write N bytes of BUF to FD at the given position OFFSET without
 /* Write N bytes of BUF to FD at the given position OFFSET without
    changing the file pointer.  Return the number written, or -1.  */
    changing the file pointer.  Return the number written, or -1.  */
 extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n,
 extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n,
-			 __off64_t __offset) __THROW;
+			 __off64_t __offset);
 # endif
 # endif
 #endif
 #endif
 
 
@@ -361,8 +383,11 @@ extern unsigned int alarm (unsigned int __seconds) __THROW;
    If a signal handler does a `longjmp' or modifies the handling of the
    If a signal handler does a `longjmp' or modifies the handling of the
    SIGALRM signal while inside `sleep' call, the handling of the SIGALRM
    SIGALRM signal while inside `sleep' call, the handling of the SIGALRM
    signal afterwards is undefined.  There is no return value to indicate
    signal afterwards is undefined.  There is no return value to indicate
-   error, but if `sleep' returns SECONDS, it probably didn't work.  */
+   error, but if `sleep' returns SECONDS, it probably didn't work.
-extern unsigned int sleep (unsigned int __seconds) __THROW;
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern unsigned int sleep (unsigned int __seconds);
 
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 /* Set an alarm to go off (generating a SIGALRM signal) in VALUE
 /* Set an alarm to go off (generating a SIGALRM signal) in VALUE
@@ -373,19 +398,25 @@ extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
      __THROW;
      __THROW;
 
 
 /* Sleep USECONDS microseconds, or until a signal arrives that is not blocked
 /* Sleep USECONDS microseconds, or until a signal arrives that is not blocked
-   or ignored.  */
+   or ignored.
-extern int usleep (__useconds_t __useconds) __THROW;
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int usleep (__useconds_t __useconds);
 #endif
 #endif
 
 
 
 
 /* Suspend the process until a signal arrives.
 /* Suspend the process until a signal arrives.
-   This always returns -1 and sets `errno' to EINTR.  */
+   This always returns -1 and sets `errno' to EINTR.
-extern int pause (void) __THROW;
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int pause (void);
 
 
 
 
 /* Change the owner and group of FILE.  */
 /* Change the owner and group of FILE.  */
 extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
 extern int chown (__const char *__file, __uid_t __owner, __gid_t __group)
-     __THROW;
+     __THROW __nonnull ((1));
 
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 /* Change the owner and group of the file that FD is open on.  */
 /* Change the owner and group of the file that FD is open on.  */
@@ -395,12 +426,12 @@ extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW;
 /* Change owner and group of FILE, if it is a symbolic
 /* Change owner and group of FILE, if it is a symbolic
    link the ownership of the symbolic link is changed.  */
    link the ownership of the symbolic link is changed.  */
 extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
 extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group)
-     __THROW;
+     __THROW __nonnull ((1));
 
 
 #endif /* Use BSD || X/Open Unix.  */
 #endif /* Use BSD || X/Open Unix.  */
 
 
 /* Change the process's working directory to PATH.  */
 /* Change the process's working directory to PATH.  */
-extern int chdir (__const char *__path) __THROW;
+extern int chdir (__const char *__path) __THROW __nonnull ((1));
 
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 /* Change the process's working directory to the one FD is open on.  */
 /* Change the process's working directory to the one FD is open on.  */
@@ -416,11 +447,19 @@ extern int fchdir (int __fd) __THROW;
    big as necessary.  */
    big as necessary.  */
 extern char *getcwd (char *__buf, size_t __size) __THROW;
 extern char *getcwd (char *__buf, size_t __size) __THROW;
 
 
+#ifdef	__USE_GNU
 /* Return a malloc'd string containing the current directory name.
 /* Return a malloc'd string containing the current directory name.
    If the environment variable `PWD' is set, and its value is correct,
    If the environment variable `PWD' is set, and its value is correct,
    that value is used.  */
    that value is used.  */
 extern char *get_current_dir_name (void) __THROW;
 extern char *get_current_dir_name (void) __THROW;
+#endif
 
 
+#if 0 /* defined __USE_BSD || defined __USE_XOPEN_EXTENDED */
+/* Put the absolute pathname of the current working directory in BUF.
+   If successful, return BUF.  If not, put an error message in
+   BUF and return NULL.  BUF should be at least PATH_MAX bytes long.  */
+extern char *getwd (char *__buf) __THROW __nonnull ((1));
+#endif
 
 
 
 
 /* Duplicate FD, returning a new file descriptor on the same file.  */
 /* Duplicate FD, returning a new file descriptor on the same file.  */
@@ -439,27 +478,40 @@ extern char **environ;
 /* Replace the current process, executing PATH with arguments ARGV and
 /* Replace the current process, executing PATH with arguments ARGV and
    environment ENVP.  ARGV and ENVP are terminated by NULL pointers.  */
    environment ENVP.  ARGV and ENVP are terminated by NULL pointers.  */
 extern int execve (__const char *__path, char *__const __argv[],
 extern int execve (__const char *__path, char *__const __argv[],
-		   char *__const __envp[]) __THROW;
+		   char *__const __envp[]) __THROW __nonnull ((1));
+
+#if 0 /* def __USE_GNU */
+/* Execute the file FD refers to, overlaying the running program image.
+   ARGV and ENVP are passed to the new program, as for `execve'.  */
+extern int fexecve (int __fd, char *__const __argv[], char *__const __envp[])
+     __THROW;
+#endif
+
 
 
 /* Execute PATH with arguments ARGV and environment from `environ'.  */
 /* Execute PATH with arguments ARGV and environment from `environ'.  */
-extern int execv (__const char *__path, char *__const __argv[]) __THROW;
+extern int execv (__const char *__path, char *__const __argv[])
+     __THROW __nonnull ((1));
 
 
 /* Execute PATH with all arguments after PATH until a NULL pointer,
 /* Execute PATH with all arguments after PATH until a NULL pointer,
    and the argument after that for environment.  */
    and the argument after that for environment.  */
-extern int execle (__const char *__path, __const char *__arg, ...) __THROW;
+extern int execle (__const char *__path, __const char *__arg, ...)
+     __THROW __nonnull ((1));
 
 
 /* Execute PATH with all arguments after PATH until
 /* Execute PATH with all arguments after PATH until
    a NULL pointer and environment from `environ'.  */
    a NULL pointer and environment from `environ'.  */
-extern int execl (__const char *__path, __const char *__arg, ...) __THROW;
+extern int execl (__const char *__path, __const char *__arg, ...)
+     __THROW __nonnull ((1));
 
 
 /* Execute FILE, searching in the `PATH' environment variable if it contains
 /* Execute FILE, searching in the `PATH' environment variable if it contains
    no slashes, with arguments ARGV and environment from `environ'.  */
    no slashes, with arguments ARGV and environment from `environ'.  */
-extern int execvp (__const char *__file, char *__const __argv[]) __THROW;
+extern int execvp (__const char *__file, char *__const __argv[])
+     __THROW __nonnull ((1));
 
 
 /* Execute FILE, searching in the `PATH' environment variable if
 /* Execute FILE, searching in the `PATH' environment variable if
    it contains no slashes, with all arguments after FILE until a
    it contains no slashes, with all arguments after FILE until a
    NULL pointer and environment from `environ'.  */
    NULL pointer and environment from `environ'.  */
-extern int execlp (__const char *__file, __const char *__arg, ...) __THROW;
+extern int execlp (__const char *__file, __const char *__arg, ...)
+     __THROW __nonnull ((1));
 
 
 
 
 #if defined __USE_MISC || defined __USE_XOPEN
 #if defined __USE_MISC || defined __USE_XOPEN
@@ -478,7 +530,8 @@ extern void _exit (int __status) __attribute__ ((__noreturn__));
 #include <bits/confname.h>
 #include <bits/confname.h>
 
 
 /* Get file-specific configuration information about PATH.  */
 /* Get file-specific configuration information about PATH.  */
-extern long int pathconf (__const char *__path, int __name) __THROW;
+extern long int pathconf (__const char *__path, int __name)
+     __THROW __nonnull ((1));
 
 
 /* Get file-specific configuration about descriptor FD.  */
 /* Get file-specific configuration about descriptor FD.  */
 extern long int fpathconf (int __fd, int __name) __THROW;
 extern long int fpathconf (int __fd, int __name) __THROW;
@@ -504,7 +557,7 @@ extern __pid_t getppid (void) __THROW;
 extern __pid_t getpgrp (void) __THROW;
 extern __pid_t getpgrp (void) __THROW;
 #else
 #else
 # ifdef __REDIRECT
 # ifdef __REDIRECT
-extern __pid_t __REDIRECT (getpgrp, (__pid_t __pid) __THROW, __getpgid);
+extern __pid_t __REDIRECT (getpgrp, (__pid_t __pid), __getpgid);
 # else
 # else
 #  define getpgrp __getpgid
 #  define getpgrp __getpgid
 # endif
 # endif
@@ -543,8 +596,7 @@ extern int setpgrp (void) __THROW;
 
 
 /* Another name for `setpgid' (above).  */
 /* Another name for `setpgid' (above).  */
 #  ifdef __REDIRECT
 #  ifdef __REDIRECT
-extern int __REDIRECT (setpgrp, (__pid_t __pid, __pid_t __pgrp) __THROW,
+extern int __REDIRECT (setpgrp, (__pid_t __pid, __pid_t __pgrp), setpgid);
-		       setpgid);
 #  else
 #  else
 #   define setpgrp setpgid
 #   define setpgrp setpgid
 #  endif
 #  endif
@@ -579,6 +631,11 @@ extern __gid_t getegid (void) __THROW;
    of its supplementary groups in LIST and return the number written.  */
    of its supplementary groups in LIST and return the number written.  */
 extern int getgroups (int __size, __gid_t __list[]) __THROW;
 extern int getgroups (int __size, __gid_t __list[]) __THROW;
 
 
+#if 0 /* def	__USE_GNU */
+/* Return nonzero iff the calling process is in group GID.  */
+extern int group_member (__gid_t __gid) __THROW;
+#endif
+
 /* Set the user ID of the calling process to UID.
 /* Set the user ID of the calling process to UID.
    If the calling process is the super-user, set the real
    If the calling process is the super-user, set the real
    and effective user IDs, and the saved set-user-ID to UID;
    and effective user IDs, and the saved set-user-ID to UID;
@@ -654,33 +711,42 @@ extern char *ttyname (int __fd) __THROW;
 
 
 /* Store at most BUFLEN characters of the pathname of the terminal FD is
 /* Store at most BUFLEN characters of the pathname of the terminal FD is
    open on in BUF.  Return 0 on success, otherwise an error number.  */
    open on in BUF.  Return 0 on success, otherwise an error number.  */
-extern int ttyname_r (int __fd, char *__buf, size_t __buflen) __THROW;
+extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
+     __THROW __nonnull ((2));
 
 
 /* Return 1 if FD is a valid descriptor associated
 /* Return 1 if FD is a valid descriptor associated
    with a terminal, zero if not.  */
    with a terminal, zero if not.  */
 extern int isatty (int __fd) __THROW;
 extern int isatty (int __fd) __THROW;
 
 
+#if 0 /* defined __USE_BSD \
+    || (defined __USE_XOPEN_EXTENDED && !defined __USE_UNIX98) */
+/* Return the index into the active-logins file (utmp) for
+   the controlling terminal.  */
+extern int ttyslot (void) __THROW;
+#endif
 
 
 
 
 /* Make a link to FROM named TO.  */
 /* Make a link to FROM named TO.  */
-extern int link (__const char *__from, __const char *__to) __THROW;
+extern int link (__const char *__from, __const char *__to)
+     __THROW __nonnull ((1, 2));
 
 
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
 /* Make a symbolic link to FROM named TO.  */
 /* Make a symbolic link to FROM named TO.  */
-extern int symlink (__const char *__from, __const char *__to) __THROW;
+extern int symlink (__const char *__from, __const char *__to)
+     __THROW __nonnull ((1, 2));
 
 
 /* Read the contents of the symbolic link PATH into no more than
 /* Read the contents of the symbolic link PATH into no more than
    LEN bytes of BUF.  The contents are not null-terminated.
    LEN bytes of BUF.  The contents are not null-terminated.
    Returns the number of characters read, or -1 for errors.  */
    Returns the number of characters read, or -1 for errors.  */
 extern int readlink (__const char *__restrict __path, char *__restrict __buf,
 extern int readlink (__const char *__restrict __path, char *__restrict __buf,
-		     size_t __len) __THROW;
+		     size_t __len) __THROW __nonnull ((1, 2));
 #endif /* Use BSD.  */
 #endif /* Use BSD.  */
 
 
 /* Remove the link NAME.  */
 /* Remove the link NAME.  */
-extern int unlink (__const char *__name) __THROW;
+extern int unlink (__const char *__name) __THROW __nonnull ((1));
 
 
 /* Remove the directory PATH.  */
 /* Remove the directory PATH.  */
-extern int rmdir (__const char *__path) __THROW;
+extern int rmdir (__const char *__path) __THROW __nonnull ((1));
 
 
 
 
 /* Return the foreground process group ID of FD.  */
 /* Return the foreground process group ID of FD.  */
@@ -690,15 +756,25 @@ extern __pid_t tcgetpgrp (int __fd) __THROW;
 extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __THROW;
 extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __THROW;
 
 
 
 
-/* Return the login name of the user.  */
+/* Return the login name of the user.
-extern char *getlogin (void) __THROW;
+
+   This function is a possible cancellation points and therefore not
+   marked with __THROW.  */
+extern char *getlogin (void);
 #if defined __USE_REENTRANT || defined __USE_UNIX98
 #if defined __USE_REENTRANT || defined __USE_UNIX98
 /* Return at most NAME_LEN characters of the login name of the user in NAME.
 /* Return at most NAME_LEN characters of the login name of the user in NAME.
    If it cannot be determined or some other error occurred, return the error
    If it cannot be determined or some other error occurred, return the error
-   code.  Otherwise return 0.  */
+   code.  Otherwise return 0.
-extern int getlogin_r (char *__name, size_t __name_len) __THROW;
+
+   This function is a possible cancellation points and therefore not
+   marked with __THROW.  */
+extern int getlogin_r (char *__name, size_t __name_len) __nonnull ((1));
 #endif
 #endif
 
 
+#if 0 /* def	__USE_BSD */
+/* Set the login name returned by `getlogin'.  */
+extern int setlogin (__const char *__name) __THROW __nonnull ((1));
+#endif
 
 
 
 
 #ifdef	__USE_POSIX2
 #ifdef	__USE_POSIX2
@@ -706,7 +782,7 @@ extern int getlogin_r (char *__name, size_t __name_len) __THROW;
    arguments in ARGV (ARGC of them, minus the program name) for
    arguments in ARGV (ARGC of them, minus the program name) for
    options given in OPTS.  */
    options given in OPTS.  */
 # define __need_getopt
 # define __need_getopt
-# include <bits/getopt.h>
+# include <getopt.h>
 #endif
 #endif
 
 
 
 
@@ -714,14 +790,15 @@ extern int getlogin_r (char *__name, size_t __name_len) __THROW;
 /* Put the name of the current host in no more than LEN bytes of NAME.
 /* Put the name of the current host in no more than LEN bytes of NAME.
    The result is null-terminated if LEN is large enough for the full
    The result is null-terminated if LEN is large enough for the full
    name and the terminator.  */
    name and the terminator.  */
-extern int gethostname (char *__name, size_t __len) __THROW;
+extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1));
 #endif
 #endif
 
 
 
 
 #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
 #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_UNIX98)
 /* Set the name of the current host to NAME, which is LEN bytes long.
 /* Set the name of the current host to NAME, which is LEN bytes long.
    This call is restricted to the super-user.  */
    This call is restricted to the super-user.  */
-extern int sethostname (__const char *__name, size_t __len) __THROW;
+extern int sethostname (__const char *__name, size_t __len)
+     __THROW __nonnull ((1));
 
 
 /* Set the current machine's Internet number to ID.
 /* Set the current machine's Internet number to ID.
    This call is restricted to the super-user.  */
    This call is restricted to the super-user.  */
@@ -731,8 +808,10 @@ extern int sethostid (long int __id) __THROW;
 /* Get and set the NIS (aka YP) domain name, if any.
 /* Get and set the NIS (aka YP) domain name, if any.
    Called just like `gethostname' and `sethostname'.
    Called just like `gethostname' and `sethostname'.
    The NIS domain name is usually the empty string when not using NIS.  */
    The NIS domain name is usually the empty string when not using NIS.  */
-extern int getdomainname (char *__name, size_t __len) __THROW;
+extern int getdomainname (char *__name, size_t __len)
-extern int setdomainname (__const char *__name, size_t __len) __THROW;
+     __THROW __nonnull ((1));
+extern int setdomainname (__const char *__name, size_t __len)
+     __THROW __nonnull ((1));
 
 
 
 
 /* Revoke access permissions to all processes currently communicating
 /* Revoke access permissions to all processes currently communicating
@@ -740,12 +819,26 @@ extern int setdomainname (__const char *__name, size_t __len) __THROW;
    group of the control terminal.  */
    group of the control terminal.  */
 extern int vhangup (void) __THROW;
 extern int vhangup (void) __THROW;
 
 
+#if 0
+/* Revoke the access of all descriptors currently open on FILE.  */
+extern int revoke (__const char *__file) __THROW __nonnull ((1));
+
+
+/* Enable statistical profiling, writing samples of the PC into at most
+   SIZE bytes of SAMPLE_BUFFER; every processor clock tick while profiling
+   is enabled, the system examines the user PC and increments
+   SAMPLE_BUFFER[((PC - OFFSET) / 2) * SCALE / 65536].  If SCALE is zero,
+   disable profiling.  Returns zero on success, -1 on error.  */
+extern int profil (unsigned short int *__sample_buffer, size_t __size,
+		   size_t __offset, unsigned int __scale)
+     __THROW __nonnull ((1));
+#endif
 
 
 
 
 /* Turn accounting on if NAME is an existing file.  The system will then write
 /* Turn accounting on if NAME is an existing file.  The system will then write
    a record for each process as it terminates, to this file.  If NAME is NULL,
    a record for each process as it terminates, to this file.  If NAME is NULL,
    turn accounting off.  This call is restricted to the super-user.  */
    turn accounting off.  This call is restricted to the super-user.  */
-extern int acct (__const char *__name) __THROW;
+extern int acct (__const char *__name) __THROW __nonnull ((1));
 
 
 
 
 /* Successive calls return the shells listed in `/etc/shells'.  */
 /* Successive calls return the shells listed in `/etc/shells'.  */
@@ -754,7 +847,7 @@ extern void endusershell (void) __THROW; /* Discard cached info.  */
 extern void setusershell (void) __THROW; /* Rewind and re-read the file.  */
 extern void setusershell (void) __THROW; /* Rewind and re-read the file.  */
 
 
 
 
-#if defined __ARCH_HAS_MMU__
+#ifdef __ARCH_HAS_MMU__
 /* Put the program in the background, and dissociate from the controlling
 /* Put the program in the background, and dissociate from the controlling
    terminal.  If NOCHDIR is zero, do `chdir ("/")'.  If NOCLOSE is zero,
    terminal.  If NOCHDIR is zero, do `chdir ("/")'.  If NOCLOSE is zero,
    redirects stdin, stdout, and stderr to /dev/null.  */
    redirects stdin, stdout, and stderr to /dev/null.  */
@@ -766,24 +859,27 @@ extern int daemon (int __nochdir, int __noclose) __THROW;
 #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
 #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K)
 /* Make PATH be the root directory (the starting point for absolute paths).
 /* Make PATH be the root directory (the starting point for absolute paths).
    This call is restricted to the super-user.  */
    This call is restricted to the super-user.  */
-extern int chroot (__const char *__path) __THROW;
+extern int chroot (__const char *__path) __THROW __nonnull ((1));
 
 
 /* Prompt with PROMPT and read a string from the terminal without echoing.
 /* Prompt with PROMPT and read a string from the terminal without echoing.
    Uses /dev/tty if possible; otherwise stderr and stdin.  */
    Uses /dev/tty if possible; otherwise stderr and stdin.  */
-extern char *getpass (__const char *__prompt) __THROW;
+extern char *getpass (__const char *__prompt) __nonnull ((1));
 #endif /* Use BSD || X/Open.  */
 #endif /* Use BSD || X/Open.  */
 
 
 
 
 #if defined __USE_BSD || defined __USE_XOPEN
 #if defined __USE_BSD || defined __USE_XOPEN
-/* Make all changes done to FD actually appear on disk.  */
+/* Make all changes done to FD actually appear on disk.
-extern int fsync (int __fd) __THROW;
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
+extern int fsync (int __fd);
 #endif /* Use BSD || X/Open.  */
 #endif /* Use BSD || X/Open.  */
 
 
 
 
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
 
 
-/* Return the current machine's Internet number.  */
+/* Return identifier for the current host.  */
-extern long int gethostid (void) __THROW;
+extern long int gethostid (void);
 
 
 /* Make all changes done to all files actually appear on disk.  */
 /* Make all changes done to all files actually appear on disk.  */
 extern void sync (void) __THROW;
 extern void sync (void) __THROW;
@@ -794,29 +890,40 @@ extern void sync (void) __THROW;
 extern int getpagesize (void)  __THROW __attribute__ ((__const__));
 extern int getpagesize (void)  __THROW __attribute__ ((__const__));
 
 
 
 
+/* Return the maximum number of file descriptors
+   the current process could possibly have.  */
+extern int getdtablesize (void) __THROW;
+
+
 /* Truncate FILE to LENGTH bytes.  */
 /* Truncate FILE to LENGTH bytes.  */
 # ifndef __USE_FILE_OFFSET64
 # ifndef __USE_FILE_OFFSET64
-extern int truncate (__const char *__file, __off_t __length) __THROW;
+extern int truncate (__const char *__file, __off_t __length)
+     __THROW __nonnull ((1));
 # else
 # else
 #  ifdef __REDIRECT
 #  ifdef __REDIRECT
 extern int __REDIRECT (truncate,
 extern int __REDIRECT (truncate,
-		       (__const char *__file, __off64_t __length) __THROW,
+			   (__const char *__file, __off64_t __length),
-		       truncate64);
+			   truncate64) __nonnull ((1));
 #  else
 #  else
 #   define truncate truncate64
 #   define truncate truncate64
 #  endif
 #  endif
 # endif
 # endif
 # ifdef __USE_LARGEFILE64
 # ifdef __USE_LARGEFILE64
-extern int truncate64 (__const char *__file, __off64_t __length) __THROW;
+extern int truncate64 (__const char *__file, __off64_t __length)
+     __THROW __nonnull ((1));
 # endif
 # endif
 
 
+#endif /* Use BSD || X/Open Unix.  */
+
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K
+
 /* Truncate the file FD is open on to LENGTH bytes.  */
 /* Truncate the file FD is open on to LENGTH bytes.  */
 # ifndef __USE_FILE_OFFSET64
 # ifndef __USE_FILE_OFFSET64
 extern int ftruncate (int __fd, __off_t __length) __THROW;
 extern int ftruncate (int __fd, __off_t __length) __THROW;
 # else
 # else
 #  ifdef __REDIRECT
 #  ifdef __REDIRECT
-extern int __REDIRECT (ftruncate, (int __fd, __off64_t __length) __THROW,
+extern int __REDIRECT (ftruncate, (int __fd, __off64_t __length),
-		       ftruncate64);
+			   ftruncate64);
 #  else
 #  else
 #   define ftruncate ftruncate64
 #   define ftruncate ftruncate64
 #  endif
 #  endif
@@ -825,12 +932,7 @@ extern int __REDIRECT (ftruncate, (int __fd, __off64_t __length) __THROW,
 extern int ftruncate64 (int __fd, __off64_t __length) __THROW;
 extern int ftruncate64 (int __fd, __off64_t __length) __THROW;
 # endif
 # endif
 
 
-
+#endif /* Use BSD || X/Open Unix || POSIX 2003.  */
-/* Return the maximum number of file descriptors
-   the current process could possibly have.  */
-extern int getdtablesize (void) __THROW;
-
-#endif /* Use BSD || X/Open Unix.  */
 
 
 
 
 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
 #if defined __USE_MISC || defined __USE_XOPEN_EXTENDED
@@ -870,7 +972,10 @@ extern long int syscall (long int __sysno, ...) __THROW;
 
 
 /* `lockf' is a simpler interface to the locking facilities of `fcntl'.
 /* `lockf' is a simpler interface to the locking facilities of `fcntl'.
    LEN is always relative to the current file position.
    LEN is always relative to the current file position.
-   The CMD argument is one of the following.  */
+   The CMD argument is one of the following.
+
+   This function is a cancellation point and therefore not marked with
+   __THROW.  */
 
 
 # define F_ULOCK 0	/* Unlock a previously locked region.  */
 # define F_ULOCK 0	/* Unlock a previously locked region.  */
 # define F_LOCK  1	/* Lock a region for exclusive use.  */
 # define F_LOCK  1	/* Lock a region for exclusive use.  */
@@ -878,17 +983,17 @@ extern long int syscall (long int __sysno, ...) __THROW;
 # define F_TEST  3	/* Test a region for other processes locks.  */
 # define F_TEST  3	/* Test a region for other processes locks.  */
 
 
 # ifndef __USE_FILE_OFFSET64
 # ifndef __USE_FILE_OFFSET64
-extern int lockf (int __fd, int __cmd, __off_t __len) __THROW;
+extern int lockf (int __fd, int __cmd, __off_t __len);
 # else
 # else
 #  ifdef __REDIRECT
 #  ifdef __REDIRECT
-extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len) __THROW,
+extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len),
 		       lockf64);
 		       lockf64);
 #  else
 #  else
 #   define lockf lockf64
 #   define lockf lockf64
 #  endif
 #  endif
 # endif
 # endif
 # ifdef __USE_LARGEFILE64
 # ifdef __USE_LARGEFILE64
-extern int lockf64 (int __fd, int __cmd, __off64_t __len) __THROW;
+extern int lockf64 (int __fd, int __cmd, __off64_t __len);
 # endif
 # endif
 #endif /* Use misc and F_LOCK not already defined.  */
 #endif /* Use misc and F_LOCK not already defined.  */
 
 
@@ -917,11 +1022,12 @@ extern int fdatasync (int __fildes) __THROW;
    be defined here.  */
    be defined here.  */
 #ifdef	__USE_XOPEN
 #ifdef	__USE_XOPEN
 /* Encrypt at most 8 characters from KEY using salt to perturb DES.  */
 /* Encrypt at most 8 characters from KEY using salt to perturb DES.  */
-extern char *crypt (__const char *__key, __const char *__salt) __THROW;
+extern char *crypt (__const char *__key, __const char *__salt)
+     __THROW __nonnull ((1, 2));
 
 
 /* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt
 /* Encrypt data in BLOCK in place if EDFLAG is zero; otherwise decrypt
    block in place.  */
    block in place.  */
-extern void encrypt (char *__block, int __edflag) __THROW;
+extern void encrypt (char *__block, int __edflag) __THROW __nonnull ((1));
 
 
 
 
 /* Swab pairs bytes in the first N bytes of the area pointed to by
 /* Swab pairs bytes in the first N bytes of the area pointed to by
@@ -929,7 +1035,7 @@ extern void encrypt (char *__block, int __edflag) __THROW;
    range [FROM - N + 1, FROM - 1].  If N is odd the first byte in FROM
    range [FROM - N + 1, FROM - 1].  If N is odd the first byte in FROM
    is without partner.  */
    is without partner.  */
 extern void swab (__const void *__restrict __from, void *__restrict __to,
 extern void swab (__const void *__restrict __from, void *__restrict __to,
-		  ssize_t __n) __THROW;
+		  ssize_t __n) __THROW __nonnull ((1, 2));
 #endif
 #endif
 
 
 
 
@@ -937,7 +1043,7 @@ extern void swab (__const void *__restrict __from, void *__restrict __to,
    It is also found in <stdio.h>.  */
    It is also found in <stdio.h>.  */
 #ifdef __USE_XOPEN
 #ifdef __USE_XOPEN
 /* Return the name of the controlling terminal.  */
 /* Return the name of the controlling terminal.  */
-extern char *ctermid (char *__s) __THROW;
+extern char *ctermid (char *__s) __THROW __nonnull ((1));
 #endif
 #endif
 
 
 __END_DECLS
 __END_DECLS