diff options
author | Ulrich Drepper <drepper@redhat.com> | 2010-01-11 14:43:46 -0800 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2010-01-11 14:43:46 -0800 |
commit | 7cdb5a32f9708af6f0dbef8c47bbd8b864d0c62e (patch) | |
tree | 786fe8a92dec6fcbfbd407c1bf04b36ed57f7741 /posix | |
parent | 64c1f3af5d6176dd32285d2e02dc93713466f82f (diff) | |
download | glibc-7cdb5a32f9708af6f0dbef8c47bbd8b864d0c62e.zip glibc-7cdb5a32f9708af6f0dbef8c47bbd8b864d0c62e.tar.gz glibc-7cdb5a32f9708af6f0dbef8c47bbd8b864d0c62e.tar.bz2 |
Fix up unistd.h for XPG7.
Diffstat (limited to 'posix')
-rw-r--r-- | posix/unistd.h | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/posix/unistd.h b/posix/unistd.h index b46a885..ae997ad 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -203,7 +203,7 @@ __BEGIN_DECLS #include <bits/posix_opt.h> /* Get the environment definitions from Unix98. */ -#ifdef __USE_UNIX98 +#if defined __USE_UNIX98 || defined __USE_XOPEN2K # include <bits/environments.h> #endif @@ -263,7 +263,7 @@ typedef __pid_t pid_t; # endif #endif /* X/Open */ -#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED +#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K # ifndef __intptr_t_defined typedef __intptr_t intptr_t; # define __intptr_t_defined @@ -362,7 +362,7 @@ extern ssize_t read (int __fd, void *__buf, size_t __nbytes) __wur; __THROW. */ extern ssize_t write (int __fd, __const void *__buf, size_t __n) __wur; -#ifdef __USE_UNIX98 +#if defined __USE_UNIX98 || defined __USE_XOPEN2K8 # ifndef __USE_FILE_OFFSET64 /* Read NBYTES into BUF from FD at the given position OFFSET without changing the file pointer. Return the number read, -1 for errors @@ -440,7 +440,8 @@ extern unsigned int alarm (unsigned int __seconds) __THROW; __THROW. */ extern unsigned int sleep (unsigned int __seconds); -#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED +#if (defined __USE_BSD || defined __USE_XOPEN_EXTENDED) \ + && !defined __USE_XOPEN2K8 /* Set an alarm to go off (generating a SIGALRM signal) in VALUE microseconds. If INTERVAL is nonzero, when the alarm goes off, the timer is reset to go off every INTERVAL microseconds thereafter. @@ -469,7 +470,7 @@ extern int pause (void); extern int chown (__const char *__file, __uid_t __owner, __gid_t __group) __THROW __nonnull ((1)) __wur; -#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED +#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* 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; @@ -492,7 +493,7 @@ extern int fchownat (int __fd, __const char *__file, __uid_t __owner, /* Change the process's working directory to PATH. */ extern int chdir (__const char *__path) __THROW __nonnull ((1)) __wur; -#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED +#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Change the process's working directory to the one FD is open on. */ extern int fchdir (int __fd) __THROW __wur; #endif @@ -513,7 +514,8 @@ extern char *getcwd (char *__buf, size_t __size) __THROW __wur; extern char *get_current_dir_name (void) __THROW; #endif -#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED +#if (defined __USE_BSD || defined __USE_XOPEN_EXTENDED) \ + && !defined __USE_XOPEN2K8 /* 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. */ @@ -639,7 +641,7 @@ extern __pid_t __REDIRECT_NTH (getpgrp, (__pid_t __pid), __getpgid); /* Get the process group ID of process PID. */ extern __pid_t __getpgid (__pid_t __pid) __THROW; -#ifdef __USE_XOPEN_EXTENDED +#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 extern __pid_t getpgid (__pid_t __pid) __THROW; #endif @@ -683,7 +685,7 @@ extern int __REDIRECT_NTH (setpgrp, (__pid_t __pid, __pid_t __pgrp), setpgid); are set to the process ID of the calling process, which is returned. */ extern __pid_t setsid (void) __THROW; -#ifdef __USE_XOPEN_EXTENDED +#if defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Return the session ID of the given process. */ extern __pid_t getsid (__pid_t __pid) __THROW; #endif @@ -772,7 +774,8 @@ extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid) and the process ID of the new process to the old process. */ extern __pid_t fork (void) __THROW; -#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED +#if (defined __USE_BSD || defined __USE_XOPEN_EXTENDED) \ + && !defined __USE_XOPEN2K8 /* Clone the calling process, but without copying the whole address space. The calling process is suspended until the new process exits or is replaced by a call to `execve'. Return -1 for errors, 0 to the new process, @@ -888,7 +891,7 @@ extern int setlogin (__const char *__name) __THROW __nonnull ((1)); #endif -#if defined __USE_BSD || defined __USE_UNIX98 +#if defined __USE_BSD || defined __USE_UNIX98 || defined __USE_XOPEN2K /* 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 name and the terminator. */ @@ -983,15 +986,21 @@ extern long int gethostid (void); extern void sync (void) __THROW; +# ifndef __USE_XOPEN2K /* Return the number of bytes in a page. This is the system's page size, which is not necessarily the same as the hardware page size. */ extern int getpagesize (void) __THROW __attribute__ ((__const__)); +# endif /* 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_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8 /* Truncate FILE to LENGTH bytes. */ # ifndef __USE_FILE_OFFSET64 @@ -1011,9 +1020,6 @@ extern int truncate64 (__const char *__file, __off64_t __length) __THROW __nonnull ((1)) __wur; # 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 @@ -1033,7 +1039,8 @@ extern int ftruncate64 (int __fd, __off64_t __length) __THROW __wur; #endif /* Use BSD || X/Open Unix || POSIX 2003. */ -#if defined __USE_MISC || defined __USE_XOPEN_EXTENDED +#if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) \ + && !defined __USE_XOPEN2K /* Set the end of accessible data space (aka "the break") to ADDR. Returns zero on success and -1 for errors (with errno set). */ @@ -1139,7 +1146,7 @@ extern void swab (__const void *__restrict __from, void *__restrict __to, /* The Single Unix specification demands this prototype to be here. It is also found in <stdio.h>. */ -#ifdef __USE_XOPEN +#if defined __USE_XOPEN || defined __USE_XOPEN2K8 /* Return the name of the controlling terminal. */ extern char *ctermid (char *__s) __THROW; #endif |