aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--conform/data/sys/types.h-data2
-rw-r--r--conform/data/unistd.h-data16
-rw-r--r--posix/unistd.h39
4 files changed, 46 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 2e5a18bfe8..4a90a9499b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
2010-01-11 Ulrich Drepper <drepper@redhat.com>
+ * posix/unistd.h: Include environments.h also for XPG6 and up.
+ Define intptr_t for XPG6 and up.
+ Fix up for XPG7.
+ * conform/data/unistd.h-data: Fix up for XPG6 and XPG7.
+
+ * conform/data/sys/types.h-data: Fix up for XPG7.
+
* sysdeps/unix/bsd/bits/stat.h: Fix double-inclusion problem.
* sysdeps/unix/sysv/linux/powerpc/bits/stat.h: Likewise.
* sysdeps/unix/sysv/linux/x86_64/bits/stat.h: Likewise.
diff --git a/conform/data/sys/types.h-data b/conform/data/sys/types.h-data
index c0b4ab73ee..4070be5c59 100644
--- a/conform/data/sys/types.h-data
+++ b/conform/data/sys/types.h-data
@@ -4,7 +4,7 @@ type blksize_t
type clock_t
type clockid_t
type dev_t
-# if !defined POSIX && !defined POSIX2008
+# if !defined POSIX
type fsblkcnt_t
type fsfilcnt_t
# endif
diff --git a/conform/data/unistd.h-data b/conform/data/unistd.h-data
index 8711499937..24fdfa752a 100644
--- a/conform/data/unistd.h-data
+++ b/conform/data/unistd.h-data
@@ -342,7 +342,9 @@ type intptr_t
function int access (const char*, int)
function {unsigned int} alarm (unsigned int)
+#if !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX && !defined POSIX2008
function int brk (void*)
+#endif
function int chdir (const char*)
#if defined XPG3 || defined XPG4 || defined UNIX98
function int chroot (const char*)
@@ -386,7 +388,9 @@ function {long int} fpathconf (int, int)
function int fsync (int)
function int ftruncate (int, off_t)
function {char*} getcwd (char*, size_t)
+#if !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX && !defined POSIX2008
function int getdtablesize (void)
+#endif
function gid_t getegid (void)
function uid_t geteuid (void)
function gid_t getgid (void)
@@ -398,17 +402,21 @@ function int gethostname (char*, size_t)
function {char*} getlogin (void)
function int getlogin_r (char*, size_t)
function int getopt (int, char*const[], const char*)
-function int getpagesize (void)
#if defined XPG3 || defined XPG4 || defined UNIX98
+function int getpagesize (void)
function {char*} getpass (const char*)
#endif
+#ifndef POSIX
function pid_t getpgid (pid_t)
+#endif
function pid_t getpgrp (void)
function pid_t getpid (void)
function pid_t getppid (void)
function pid_t getsid (pid_t)
function uid_t getuid (void)
+#if defined XPG3 || defined XPG4 || defined UNIX98 || defined XOPEN2K
function {char*} getwd (char*)
+#endif
function int isatty (int)
function int lchown (const char*, uid_t, gid_t)
function int link (const char*, const char*)
@@ -436,7 +444,9 @@ function ssize_t readlink (const char*, char*, size_t)
function ssize_t readlinkat (int, const char*, char*, size_t)
# endif
function int rmdir (const char*)
+#if !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX && !defined POSIX2008
function {void*} sbrk (intptr_t)
+#endif
function int setegid (gid_t)
function int seteuid (uid_t)
function int setgid (gid_t)
@@ -465,13 +475,17 @@ function int tcsetpgrp (int, pid_t)
function int truncate (const char*, off_t)
function {char*} ttyname (int)
function int ttyname_r (int, char*, size_t)
+#if defined XPG3 || defined XPG4 || defined UNIX98 || defined XOPEN2K
function useconds_t ualarm (useconds_t, useconds_t)
+#endif
function int unlink (const char*)
# if defined XOPEN2K8 || defined POSIX2008
function int unlinkat (int, const char*, int)
# endif
+#if defined XPG3 || defined XPG4 || defined UNIX98 || defined XOPEN2K
function int usleep (useconds_t)
function pid_t vfork (void)
+#endif
function ssize_t write (int, const void*, size_t)
variable {char*} optarg
diff --git a/posix/unistd.h b/posix/unistd.h
index b46a885afa..ae997adc63 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