diff options
author | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:10:10 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2004-12-22 20:10:10 +0000 |
commit | a334319f6530564d22e775935d9c91663623a1b4 (patch) | |
tree | b5877475619e4c938e98757d518bb1e9cbead751 /posix/unistd.h | |
parent | 0ecb606cb6cf65de1d9fc8a919bceb4be476c602 (diff) | |
download | glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.gz glibc-a334319f6530564d22e775935d9c91663623a1b4.tar.xz glibc-a334319f6530564d22e775935d9c91663623a1b4.zip |
(CFLAGS-tst-align.c): Add -mpreferred-stack-boundary=4.
Diffstat (limited to 'posix/unistd.h')
-rw-r--r-- | posix/unistd.h | 194 |
1 files changed, 65 insertions, 129 deletions
diff --git a/posix/unistd.h b/posix/unistd.h index 4e1e9dfaa2..5d42169e82 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -1,4 +1,4 @@ -/* Copyright (C) 1991-2006, 2007 Free Software Foundation, Inc. +/* Copyright (C) 1991-2002, 2003, 2004 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -56,9 +56,7 @@ __BEGIN_DECLS #define _POSIX2_LOCALEDEF 200112L /* X/Open version number to which the library conforms. It is selectable. */ -#ifdef __USE_XOPEN2K -# define _XOPEN_VERSION 600 -#elif defined __USE_UNIX98 +#ifdef __USE_UNIX98 # define _XOPEN_VERSION 500 #else # define _XOPEN_VERSION 4 @@ -262,20 +260,8 @@ extern int access (__const char *__name, int __type) __THROW __nonnull ((1)); (as normal file operations use). */ extern int euidaccess (__const char *__name, int __type) __THROW __nonnull ((1)); - -/* An alias for `euidaccess', used by some other systems. */ -extern int eaccess (__const char *__name, int __type) - __THROW __nonnull ((1)); #endif -#ifdef __USE_ATFILE -/* Test for access to FILE relative to the directory FD is open on. - If AT_EACCESS is set in FLAG, then use effective IDs like `eaccess', - otherwise use real IDs like `access'. */ -extern int faccessat (int __fd, __const char *__file, int __type, int __flag) - __THROW __nonnull ((2)) __wur; -#endif /* Use GNU. */ - /* Values for the WHENCE argument to lseek. */ #ifndef _STDIO_H /* <stdio.h> has the same definitions. */ @@ -309,8 +295,7 @@ extern __off64_t __REDIRECT_NTH (lseek, # endif #endif #ifdef __USE_LARGEFILE64 -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 /* Close the file descriptor FD. @@ -324,13 +309,13 @@ extern int close (int __fd); This function is a cancellation point and therefore not marked with __THROW. */ -extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur; +extern ssize_t read (int __fd, void *__buf, size_t __nbytes); /* Write N bytes of BUF to FD. Return the number written, or -1. This function is a cancellation point and therefore not marked with __THROW. */ -extern ssize_t write (int __fd, __const void *__buf, size_t __n) __wur; +extern ssize_t write (int __fd, __const void *__buf, size_t __n); #ifdef __USE_UNIX98 # ifndef __USE_FILE_OFFSET64 @@ -341,7 +326,7 @@ extern ssize_t write (int __fd, __const void *__buf, size_t __n) __wur; 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) __wur; + __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. @@ -349,15 +334,15 @@ extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, This function is a cancellation point and therefore not marked with __THROW. */ extern ssize_t pwrite (int __fd, __const void *__buf, size_t __n, - __off_t __offset) __wur; + __off_t __offset); # else # ifdef __REDIRECT extern ssize_t __REDIRECT (pread, (int __fd, void *__buf, size_t __nbytes, __off64_t __offset), - pread64) __wur; + pread64); extern ssize_t __REDIRECT (pwrite, (int __fd, __const void *__buf, size_t __nbytes, __off64_t __offset), - pwrite64) __wur; + pwrite64); # else # define pread pread64 # define pwrite pwrite64 @@ -369,11 +354,11 @@ extern ssize_t __REDIRECT (pwrite, (int __fd, __const void *__buf, changing the file pointer. Return the number read, -1 for errors or 0 for EOF. */ extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes, - __off64_t __offset) __wur; + __off64_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. */ extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n, - __off64_t __offset) __wur; + __off64_t __offset); # endif #endif @@ -381,7 +366,7 @@ extern ssize_t pwrite64 (int __fd, __const void *__buf, size_t __n, If successful, two file descriptors are stored in PIPEDES; bytes written on PIPEDES[1] can be read from PIPEDES[0]. Returns 0 if successful, -1 if not. */ -extern int pipe (int __pipedes[2]) __THROW __wur; +extern int pipe (int __pipedes[2]) __THROW; /* Schedule an alarm. In SECONDS seconds, the process will get a SIGALRM. If SECONDS is zero, any currently scheduled alarm will be cancelled. @@ -431,34 +416,26 @@ extern int pause (void); /* Change the owner and group of FILE. */ extern int chown (__const char *__file, __uid_t __owner, __gid_t __group) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)); #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED /* Change the owner and group of the file that FD is open on. */ -extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW __wur; +extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __THROW; /* Change owner and group of FILE, if it is a symbolic link the ownership of the symbolic link is changed. */ extern int lchown (__const char *__file, __uid_t __owner, __gid_t __group) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)); #endif /* Use BSD || X/Open Unix. */ -#ifdef __USE_ATFILE -/* Change the owner and group of FILE relative to the directory FD is open - on. */ -extern int fchownat (int __fd, __const char *__file, __uid_t __owner, - __gid_t __group, int __flag) - __THROW __nonnull ((2)) __wur; -#endif /* Use GNU. */ - /* Change the process's working directory to PATH. */ -extern int chdir (__const char *__path) __THROW __nonnull ((1)) __wur; +extern int chdir (__const char *__path) __THROW __nonnull ((1)); #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED /* Change the process's working directory to the one FD is open on. */ -extern int fchdir (int __fd) __THROW __wur; +extern int fchdir (int __fd) __THROW; #endif /* Get the pathname of the current working directory, @@ -468,7 +445,7 @@ extern int fchdir (int __fd) __THROW __wur; an array is allocated with `malloc'; the array is SIZE bytes long, unless SIZE == 0, in which case it is as big as necessary. */ -extern char *getcwd (char *__buf, size_t __size) __THROW __wur; +extern char *getcwd (char *__buf, size_t __size) __THROW; #ifdef __USE_GNU /* Return a malloc'd string containing the current directory name. @@ -481,13 +458,12 @@ extern char *get_current_dir_name (void) __THROW; /* 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)) __attribute_deprecated__ __wur; +extern char *getwd (char *__buf) __THROW __nonnull ((1)); #endif /* Duplicate FD, returning a new file descriptor on the same file. */ -extern int dup (int __fd) __THROW __wur; +extern int dup (int __fd) __THROW; /* Duplicate FD to FD2, closing FD2 and making it open on the same file. */ extern int dup2 (int __fd, int __fd2) __THROW; @@ -540,7 +516,7 @@ extern int execlp (__const char *__file, __const char *__arg, ...) #if defined __USE_MISC || defined __USE_XOPEN /* Add INC to priority of the current process. */ -extern int nice (int __inc) __THROW __wur; +extern int nice (int __inc) __THROW; #endif @@ -653,7 +629,7 @@ extern __gid_t getegid (void) __THROW; /* If SIZE is zero, return the number of supplementary groups the calling process is in. Otherwise, fill in the group IDs of its supplementary groups in LIST and return the number written. */ -extern int getgroups (int __size, __gid_t __list[]) __THROW __wur; +extern int getgroups (int __size, __gid_t __list[]) __THROW; #ifdef __USE_GNU /* Return nonzero iff the calling process is in group GID. */ @@ -695,25 +671,21 @@ extern int setegid (__gid_t __gid) __THROW; #endif /* Use BSD. */ #ifdef __USE_GNU -/* Fetch the real user ID, effective user ID, and saved-set user ID, +/* Fetch the effective user ID, real user ID, and saved-set user ID, of the calling process. */ -extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid) - __THROW; +extern int getresuid (__uid_t *__euid, __uid_t *__ruid, __uid_t *__suid); -/* Fetch the real group ID, effective group ID, and saved-set group ID, +/* Fetch the effective group ID, real group ID, and saved-set group ID, of the calling process. */ -extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid) - __THROW; +extern int getresgid (__gid_t *__egid, __gid_t *__rgid, __gid_t *__sgid); -/* Set the real user ID, effective user ID, and saved-set user ID, - of the calling process to RUID, EUID, and SUID, respectively. */ -extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid) - __THROW; +/* Set the effective user ID, real user ID, and saved-set user ID, + of the calling process to EUID, RUID, and SUID, respectively. */ +extern int setresuid (__uid_t __euid, __uid_t __ruid, __uid_t __suid); -/* Set the real group ID, effective group ID, and saved-set group ID, - of the calling process to RGID, EGID, and SGID, respectively. */ -extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid) - __THROW; +/* Set the effective group ID, real group ID, and saved-set group ID, + of the calling process to EGID, RGID, and SGID, respectively. */ +extern int setresgid (__gid_t __egid, __gid_t __rgid, __gid_t __sgid); #endif @@ -738,7 +710,7 @@ extern char *ttyname (int __fd) __THROW; /* 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. */ extern int ttyname_r (int __fd, char *__buf, size_t __buflen) - __THROW __nonnull ((2)) __wur; + __THROW __nonnull ((2)); /* Return 1 if FD is a valid descriptor associated with a terminal, zero if not. */ @@ -754,49 +726,23 @@ extern int ttyslot (void) __THROW; /* Make a link to FROM named TO. */ extern int link (__const char *__from, __const char *__to) - __THROW __nonnull ((1, 2)) __wur; - -#ifdef __USE_ATFILE -/* Like link but relative paths in TO and FROM are interpreted relative - to FROMFD and TOFD respectively. */ -extern int linkat (int __fromfd, __const char *__from, int __tofd, - __const char *__to, int __flags) - __THROW __nonnull ((2, 4)) __wur; -#endif + __THROW __nonnull ((1, 2)); -#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K +#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED /* Make a symbolic link to FROM named TO. */ extern int symlink (__const char *__from, __const char *__to) - __THROW __nonnull ((1, 2)) __wur; + __THROW __nonnull ((1, 2)); /* Read the contents of the symbolic link PATH into no more than LEN bytes of BUF. The contents are not null-terminated. Returns the number of characters read, or -1 for errors. */ -extern ssize_t readlink (__const char *__restrict __path, - char *__restrict __buf, size_t __len) - __THROW __nonnull ((1, 2)) __wur; +extern int readlink (__const char *__restrict __path, char *__restrict __buf, + size_t __len) __THROW __nonnull ((1, 2)); #endif /* Use BSD. */ -#ifdef __USE_ATFILE -/* Like symlink but a relative path in TO is interpreted relative to TOFD. */ -extern int symlinkat (__const char *__from, int __tofd, - __const char *__to) __THROW __nonnull ((1, 3)) __wur; - -/* Like readlink but a relative PATH is interpreted relative to FD. */ -extern ssize_t readlinkat (int __fd, __const char *__restrict __path, - char *__restrict __buf, size_t __len) - __THROW __nonnull ((2, 3)) __wur; -#endif - /* Remove the link NAME. */ extern int unlink (__const char *__name) __THROW __nonnull ((1)); -#ifdef __USE_ATFILE -/* Remove the link NAME relative to FD. */ -extern int unlinkat (int __fd, __const char *__name, int __flag) - __THROW __nonnull ((2)); -#endif - /* Remove the directory PATH. */ extern int rmdir (__const char *__path) __THROW __nonnull ((1)); @@ -813,7 +759,7 @@ extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __THROW; This function is a possible cancellation points and therefore not marked with __THROW. */ extern char *getlogin (void); -#if defined __USE_REENTRANT || defined __USE_POSIX199506 +#if defined __USE_REENTRANT || defined __USE_UNIX98 /* 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 code. Otherwise return 0. @@ -850,20 +796,20 @@ extern int gethostname (char *__name, size_t __len) __THROW __nonnull ((1)); /* Set the name of the current host to NAME, which is LEN bytes long. This call is restricted to the super-user. */ extern int sethostname (__const char *__name, size_t __len) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)); /* Set the current machine's Internet number to ID. This call is restricted to the super-user. */ -extern int sethostid (long int __id) __THROW __wur; +extern int sethostid (long int __id) __THROW; /* Get and set the NIS (aka YP) domain name, if any. Called just like `gethostname' and `sethostname'. The NIS domain name is usually the empty string when not using NIS. */ extern int getdomainname (char *__name, size_t __len) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)); extern int setdomainname (__const char *__name, size_t __len) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)); /* Revoke access permissions to all processes currently communicating @@ -872,7 +818,7 @@ extern int setdomainname (__const char *__name, size_t __len) extern int vhangup (void) __THROW; /* Revoke the access of all descriptors currently open on FILE. */ -extern int revoke (__const char *__file) __THROW __nonnull ((1)) __wur; +extern int revoke (__const char *__file) __THROW __nonnull ((1)); /* Enable statistical profiling, writing samples of the PC into at most @@ -888,7 +834,7 @@ extern int profil (unsigned short int *__sample_buffer, size_t __size, /* 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, 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'. */ @@ -900,14 +846,14 @@ extern void setusershell (void) __THROW; /* Rewind and re-read the file. */ /* Put the program in the background, and dissociate from the controlling terminal. If NOCHDIR is zero, do `chdir ("/")'. If NOCLOSE is zero, redirects stdin, stdout, and stderr to /dev/null. */ -extern int daemon (int __nochdir, int __noclose) __THROW __wur; +extern int daemon (int __nochdir, int __noclose) __THROW; #endif /* Use BSD || X/Open. */ #if defined __USE_BSD || (defined __USE_XOPEN && !defined __USE_XOPEN2K) /* Make PATH be the root directory (the starting point for absolute paths). This call is restricted to the super-user. */ -extern int chroot (__const char *__path) __THROW __nonnull ((1)) __wur; +extern int chroot (__const char *__path) __THROW __nonnull ((1)); /* Prompt with PROMPT and read a string from the terminal without echoing. Uses /dev/tty if possible; otherwise stderr and stdin. */ @@ -938,56 +884,52 @@ extern void sync (void) __THROW; 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. */ # ifndef __USE_FILE_OFFSET64 extern int truncate (__const char *__file, __off_t __length) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)); # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (truncate, (__const char *__file, __off64_t __length), - truncate64) __nonnull ((1)) __wur; + truncate64) __nonnull ((1)); # else # define truncate truncate64 # endif # endif # ifdef __USE_LARGEFILE64 extern int truncate64 (__const char *__file, __off64_t __length) - __THROW __nonnull ((1)) __wur; + __THROW __nonnull ((1)); # 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. */ # ifndef __USE_FILE_OFFSET64 -extern int ftruncate (int __fd, __off_t __length) __THROW __wur; +extern int ftruncate (int __fd, __off_t __length) __THROW; # else # ifdef __REDIRECT_NTH extern int __REDIRECT_NTH (ftruncate, (int __fd, __off64_t __length), - ftruncate64) __wur; + ftruncate64); # else # define ftruncate ftruncate64 # endif # endif # ifdef __USE_LARGEFILE64 -extern int ftruncate64 (int __fd, __off64_t __length) __THROW __wur; +extern int ftruncate64 (int __fd, __off64_t __length) __THROW; # 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 /* Set the end of accessible data space (aka "the break") to ADDR. Returns zero on success and -1 for errors (with errno set). */ -extern int brk (void *__addr) __THROW __wur; +extern int brk (void *__addr) __THROW; /* Increase or decrease the end of accessible data space by DELTA bytes. If successful, returns the address the previous end of data space @@ -1031,17 +973,17 @@ extern long int syscall (long int __sysno, ...) __THROW; # define F_TEST 3 /* Test a region for other processes locks. */ # ifndef __USE_FILE_OFFSET64 -extern int lockf (int __fd, int __cmd, __off_t __len) __wur; +extern int lockf (int __fd, int __cmd, __off_t __len); # else # ifdef __REDIRECT extern int __REDIRECT (lockf, (int __fd, int __cmd, __off64_t __len), - lockf64) __wur; + lockf64); # else # define lockf lockf64 # endif # endif # ifdef __USE_LARGEFILE64 -extern int lockf64 (int __fd, int __cmd, __off64_t __len) __wur; +extern int lockf64 (int __fd, int __cmd, __off64_t __len); # endif #endif /* Use misc and F_LOCK not already defined. */ @@ -1062,7 +1004,7 @@ extern int lockf64 (int __fd, int __cmd, __off64_t __len) __wur; #if defined __USE_POSIX199309 || defined __USE_UNIX98 /* Synchronize at least the data part of a file with the underlying media. */ -extern int fdatasync (int __fildes); +extern int fdatasync (int __fildes) __THROW; #endif /* Use POSIX199309 */ @@ -1091,13 +1033,7 @@ extern void swab (__const void *__restrict __from, void *__restrict __to, It is also found in <stdio.h>. */ #ifdef __USE_XOPEN /* Return the name of the controlling terminal. */ -extern char *ctermid (char *__s) __THROW; -#endif - - -/* Define some macros helping to catch buffer overflows. */ -#if __USE_FORTIFY_LEVEL > 0 && !defined __cplusplus -# include <bits/unistd.h> +extern char *ctermid (char *__s) __THROW __nonnull ((1)); #endif __END_DECLS |