summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2010-01-12 15:57:53 +0100
committerAndreas Schwab <schwab@redhat.com>2010-01-12 16:02:34 +0100
commit4ec90460fef4a641be743d730623be96b93dad8a (patch)
treecf222cac5df605832c6dde7a90a9695e54068857
parent9b0eb94309fd846536bae6b70aebcb6a66667742 (diff)
parent8500fa8325bb9dde4ebb3aa59a52fd2ffdc07f54 (diff)
Merge remote branch 'origin/master' into fedora/master
-rw-r--r--ChangeLog54
-rw-r--r--conform/data/math.h-data25
-rw-r--r--conform/data/sys/stat.h-data6
-rw-r--r--conform/data/sys/types.h-data2
-rw-r--r--conform/data/tgmath.h-data33
-rw-r--r--conform/data/time.h-data2
-rw-r--r--conform/data/unistd.h-data30
-rw-r--r--conform/data/wchar.h-data14
-rw-r--r--conform/data/wordexp.h-data2
-rw-r--r--include/features.h6
-rw-r--r--io/fcntl.h5
-rw-r--r--io/sys/stat.h9
-rw-r--r--posix/sys/wait.h2
-rw-r--r--posix/unistd.h39
-rw-r--r--stdlib/stdlib.h12
-rw-r--r--sysdeps/mach/hurd/bits/stat.h7
-rw-r--r--sysdeps/unix/bsd/bits/stat.h5
-rw-r--r--sysdeps/unix/sysv/bits/stat.h5
-rw-r--r--sysdeps/unix/sysv/linux/bits/stat.h5
-rw-r--r--sysdeps/unix/sysv/linux/ia64/bits/stat.h5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/bits/stat.h5
-rw-r--r--sysdeps/unix/sysv/linux/s390/bits/stat.h5
-rw-r--r--sysdeps/unix/sysv/linux/sparc/bits/stat.h5
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/bits/stat.h5
-rw-r--r--termios/termios.h4
25 files changed, 233 insertions, 59 deletions
diff --git a/ChangeLog b/ChangeLog
index 10db9939c9..a7e4973d4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,55 @@
-2010-01-11 Andreas Schwab <schwab@redhat.com>
+2010-01-12 Jakub Jelinek <jakub@redhat.com>
- * io/fcntl.h: Only include <bits/stat.h> once.
- * io/sys/stat.h: Likewise.
+ * posix/sys/wait.h: Don't define W* macros etc. if
+ stdlib.h has been included with _POSIX_C_SOURCE >= 200809L.
+
+2010-01-11 Ulrich Drepper <drepper@redhat.com>
+
+ * io/sys/stat.h: Declare fchmod for XPG7.
+ * conform/data/sys/stat.h-data: Fix up for XPG7.
+
+ * termios/termios.h: Define pid_t for XPG7.
+
+ * conform/data/math.h-data: Fix up for XPG6 and XPG7.
+ * conform/data/tgmath.h-data: Likewise.
+
+ * conform/data/time.h-data: Fix POSIX tests.
+
+ * conform/data/wchar.h-data: Fix up XPG7 tests.
+
+ * include/features.h: Fix __USE_ISOC95 handling.
+
+ * conform/data/wordexp.h-data: Fix typo in last change.
+
+ * conform/data/unistd.h-data: Fix up older POSIX tests.
+
+ * stdlib/stdlib.h: Fix handling symbols removed in XPG7.
+ * posix/unistd.h: Likewise.
+
+ * 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.
+ * sysdeps/unix/sysv/linux/s390/bits/stat.h: Likewise.
+ * sysdeps/unix/sysv/linux/sparc/bits/stat.h: Likewise.
+ * sysdeps/unix/sysv/linux/bits/stat.h: Likewise.
+ * sysdeps/unix/sysv/linux/ia64/bits/stat.h: Likewise.
+ * sysdeps/unix/sysv/bits/stat.h: Likewise.
+ * sysdeps/mach/hurd/bits/stat.h: Likewise.
+
+ * bits/confname.h: Fix typo in last change.
+
+ * conform/data/unistd.h-data: lockf-constants Not needed for POSIX.
+
+2010-01-11 Andreas Schwab <schwab@redhat.com>
- * bits/confname.h: Add missing comma, remove trailing commas.
+ * bits/confname.h: Remove trailing comma.
2010-01-10 Ulrich Drepper <drepper@redhat.com>
diff --git a/conform/data/math.h-data b/conform/data/math.h-data
index da9ce68fc2..f55e63298c 100644
--- a/conform/data/math.h-data
+++ b/conform/data/math.h-data
@@ -52,6 +52,8 @@ macro MATH_ERRNO == 1
macro MATH_ERREXCEPT == 2
#endif
+macro math_errhandling
+
function double acos (double)
function double asin (double)
function double atan (double)
@@ -79,7 +81,9 @@ function double tan (double)
function double tanh (double)
function double erf (double)
function double erfc (double)
+#if defined XPG3 || defined XPG4 || defined UNIX98
function double gamma (double)
+#endif
function double hypot (double, double)
#if !defined POSIX && !defined POSIX2008
function double j0 (double)
@@ -93,7 +97,6 @@ function double y0 (double)
function double y1 (double)
function double yn (int, double)
#endif
-function int isnan (double)
function double acosh (double)
function double asinh (double)
function double atanh (double)
@@ -114,7 +117,9 @@ function {long long} llrint (double)
function long lround (double)
function {long long} llround (double)
function double remquo (double, double, int*)
+#if defined XPG3 && defined XPG4 && defined UNIX98 && defined XOPEN2K
function double scalb (double, double)
+#endif
function double scalbn (double, int)
function double scalbln (double, long)
function double fdim (double, double)
@@ -156,17 +161,22 @@ function float tanf (float)
function float tanhf (float)
function float erff (float)
function float erfcf (float)
+#if defined XPG3 || defined XPG4 || defined UNIX98
function float gammaf (float)
+#endif
function float hypotf (float, float)
+#if !defined POSIX && !defined POSIX2008
function float j0f (float)
function float j1f (float)
function float jnf (int, float)
+#endif
function float lgammaf (float)
function float tgammaf (float)
+#if !defined POSIX && !defined POSIX2008
function float y0f (float)
function float y1f (float)
function float ynf (int, float)
-function int isnanf (float)
+#endif
function float acoshf (float)
function float asinhf (float)
function float atanhf (float)
@@ -187,7 +197,9 @@ function {long long} llrintf (float)
function long lroundf (float)
function {long long} llroundf (float)
function float remquof (float, float, int*)
+#if defined XPG3 && defined XPG4 && defined UNIX98 && defined XOPEN2K
function float scalbf (float, float)
+#endif
function float scalbnf (float, int)
function float scalblnf (float, long)
function float fdimf (float, float)
@@ -223,17 +235,22 @@ function {long double} tanl (long double)
function {long double} tanhl (long double)
function {long double} erfl (long double)
function {long double} erfcl (long double)
+#if defined XPG3 || defined XPG4 || defined UNIX98
function {long double} gammal (long double)
+#endif
function {long double} hypotl (long double, long double)
+#if !defined POSIX && !defined POSIX2008
function {long double} j0l (long double)
function {long double} j1l (long double)
function {long double} jnl (int, long double)
+#endif
function {long double} lgammal (long double)
function {long double} tgammal (long double)
+#if !defined POSIX && !defined POSIX2008
function {long double} y0l (long double)
function {long double} y1l (long double)
function {long double} ynl (int, long double)
-function int isnanl (long double)
+#endif
function {long double} acoshl (long double)
function {long double} asinhl (long double)
function {long double} atanhl (long double)
@@ -254,7 +271,9 @@ function {long long} llrintl (long double)
function long lroundl (long double)
function {long long} llroundl (long double)
function {long double} remquol (long double, long double, int*)
+#if defined XPG3 && defined XPG4 && defined UNIX98 && defined XOPEN2K
function {long double} scalbl (long double, long double)
+#endif
function {long double} scalbnl (long double, int)
function {long double} scalblnl (long double, long)
function {long double} fdiml (long double, long double)
diff --git a/conform/data/sys/stat.h-data b/conform/data/sys/stat.h-data
index 72c656f19e..df39fd3d81 100644
--- a/conform/data/sys/stat.h-data
+++ b/conform/data/sys/stat.h-data
@@ -20,8 +20,10 @@ element {struct stat} blksize_t st_blksize
element {struct stat} blkcnt_t st_blocks
#endif
+#if !defined POSIX && !defined POSIX2008
type blkcnt_t
type blksize_t
+#endif
type dev_t
type ino_t
type mode_t
@@ -30,7 +32,7 @@ type uid_t
type gid_t
type off_t
type time_t
-# ifdef XOPEN2K8
+# if defined XOPEN2K8 || defined POSIX2008
type {struct timespec}
element {struct timespec} time_t tv_sec
element {struct timespec} long tv_nsec
@@ -107,8 +109,6 @@ function int mkfifoat (int, const char*, mode_t)
# endif
# if !defined POSIX && !defined POSIX2008
function int mknod (const char*, mode_t, dev_t)
-# endif
-# if defined XOPEN2K8 || defined POSIX2008
function int mknodat (int, const char*, mode_t, dev_t)
# endif
function int stat (const char*, struct stat*)
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/tgmath.h-data b/conform/data/tgmath.h-data
index 2a6bd0cd9a..ce4f301de9 100644
--- a/conform/data/tgmath.h-data
+++ b/conform/data/tgmath.h-data
@@ -1,4 +1,4 @@
-#ifdef XOPEN2K
+#if defined XOPEN2K || defined POSIX2008
// <math.h>
macro fpclassify
macro isfinite
@@ -13,6 +13,7 @@ macro islessequal
macro islessgreater
macro isunordered
+#ifndef POSIX2008
constant M_E
constant M_LOG2E
constant M_LOG10E
@@ -28,6 +29,7 @@ constant M_SQRT2
constant M_SQRT1_2
constant MAXFLOAT
+#endif
constant HUGE_VAL
constant HUGE_VALF
constant HUGE_VALL
@@ -50,6 +52,8 @@ constant FP_ILOGBNAN
macro MATH_ERRNO == 1
macro MATH_ERREXCEPT == 2
+macro math_errhandling
+
function double acos (double)
function double asin (double)
function double atan (double)
@@ -77,17 +81,22 @@ function double tan (double)
function double tanh (double)
function double erf (double)
function double erfc (double)
+#if defined XPG3 || defined XPG4 || defined UNIX98
function double gamma (double)
+#endif
function double hypot (double, double)
+#if !defined POSIX && !defined POSIX2008
function double j0 (double)
function double j1 (double)
function double jn (int, double)
+#endif
function double lgamma (double)
function double tgamma (double)
+#if !defined POSIX && !defined POSIX2008
function double y0 (double)
function double y1 (double)
function double yn (int, double)
-function int isnan (double)
+#endif
function double acosh (double)
function double asinh (double)
function double atanh (double)
@@ -108,7 +117,9 @@ function {long long} llrint (double)
function long lround (double)
function {long long} llround (double)
function double remquo (double, double, int*)
+#if defined XPG3 && defined XPG4 && defined UNIX98 && defined XOPEN2K
function double scalb (double, double)
+#endif
function double scalbn (double, int)
function double scalbln (double, long)
function double fdim (double, double)
@@ -147,17 +158,22 @@ function float tanf (float)
function float tanhf (float)
function float erff (float)
function float erfcf (float)
+#if defined XPG3 || defined XPG4 || defined UNIX98
function float gammaf (float)
+#endif
function float hypotf (float, float)
+#if !defined POSIX && !defined POSIX2008
function float j0f (float)
function float j1f (float)
function float jnf (int, float)
+#endif
function float lgammaf (float)
function float tgammaf (float)
+#if !defined POSIX && !defined POSIX2008
function float y0f (float)
function float y1f (float)
function float ynf (int, float)
-function int isnanf (float)
+#endif
function float acoshf (float)
function float asinhf (float)
function float atanhf (float)
@@ -178,7 +194,9 @@ function {long long} llrintf (float)
function long lroundf (float)
function {long long} llroundf (float)
function float remquof (float, float, int*)
+#if defined XPG3 && defined XPG4 && defined UNIX98 && defined XOPEN2K
function float scalbf (float, float)
+#endif
function float scalbnf (float, int)
function float scalblnf (float, long)
function float fdimf (float, float)
@@ -214,17 +232,22 @@ function {long double} tanl (long double)
function {long double} tanhl (long double)
function {long double} erfl (long double)
function {long double} erfcl (long double)
+#if defined XPG3 || defined XPG4 || defined UNIX98
function {long double} gammal (long double)
+#endif
function {long double} hypotl (long double, long double)
+#if !defined POSIX && !defined POSIX2008
function {long double} j0l (long double)
function {long double} j1l (long double)
function {long double} jnl (int, long double)
+#endif
function {long double} lgammal (long double)
function {long double} tgammal (long double)
+#if !defined POSIX && !defined POSIX2008
function {long double} y0l (long double)
function {long double} y1l (long double)
function {long double} ynl (int, long double)
-function int isnanl (long double)
+#endif
function {long double} acoshl (long double)
function {long double} asinhl (long double)
function {long double} atanhl (long double)
@@ -245,7 +268,9 @@ function {long long} llrintl (long double)
function long lroundl (long double)
function {long long} llroundl (long double)
function {long double} remquol (long double, long double, int*)
+#if defined XPG3 && defined XPG4 && defined UNIX98 && defined XOPEN2K
function {long double} scalbl (long double, long double)
+#endif
function {long double} scalbnl (long double, int)
function {long double} scalblnl (long double, long)
function {long double} fdiml (long double, long double)
diff --git a/conform/data/time.h-data b/conform/data/time.h-data
index 631cb76a1e..c07fe1dc3b 100644
--- a/conform/data/time.h-data
+++ b/conform/data/time.h-data
@@ -44,7 +44,9 @@ type locale_t
tag {struct sigevent}
#endif
+#if !defined POSIX && !defined POSIX2008
variable int getdate_err
+#endif
function {char*} asctime (const struct tm*)
function {char*} asctime_r (const struct tm*, char*)
diff --git a/conform/data/unistd.h-data b/conform/data/unistd.h-data
index 96cdf6a3aa..72fbdd62b9 100644
--- a/conform/data/unistd.h-data
+++ b/conform/data/unistd.h-data
@@ -300,10 +300,12 @@ constant _CS_V7_ENV
constant _SC_THREAD_ROBUST_PRIO_INHERIT
constant _SC_THREAD_ROBUST_PRIO_PROTECT
+#if !defined POSIX && !defined POSIX2008
constant F_LOCK
constant F_ULOCK
constant F_TEST
constant F_TLOCK
+#endif
constant _PC_ASYNC_IO
constant _PC_CHOWN_RESTRICTED
@@ -340,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*)
@@ -374,7 +378,9 @@ function int fchown (int, uid_t, gid_t)
# if defined XOPEN2K8 || defined POSIX2008
function int fchownat (int, const char*, uid_t, gid_t, int)
# endif
+#ifndef POSIX
function int fchdir (int)
+#endif
function int fdatasync (int)
# if defined XOPEN2K8 || defined POSIX2008
function int fexecve (int, char *const[], char *const[])
@@ -384,7 +390,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)
@@ -396,19 +404,27 @@ 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)
+#ifndef POSIX
function pid_t getsid (pid_t)
+#endif
function uid_t getuid (void)
+#if defined XPG3 || defined XPG4 || defined UNIX98 || defined XOPEN2K
function {char*} getwd (char*)
+#endif
function int isatty (int)
+#ifndef POSIX
function int lchown (const char*, uid_t, gid_t)
+#endif
function int link (const char*, const char*)
# if defined XOPEN2K8 || defined POSIX2008
function int linkat (int, const char*, int, const char*, int)
@@ -423,18 +439,24 @@ function int nice (int)
function {long int} pathconf (const char*, int)
function int pause (void)
function int pipe (int[2])
+#ifndef POSIX
function ssize_t pread (int, void*, size_t, off_t)
+#endif
#if !defined XOPEN2K && !defined XOPEN2K8 && !defined POSIX2008
function int pthread_atfork (void(*)(void), void(*)(void), void(*)(void))
#endif
+#ifndef POSIX
function ssize_t pwrite (int, const void*, size_t, off_t)
+#endif
function ssize_t read (int, void*, size_t)
function ssize_t readlink (const char*, char*, size_t)
# if defined XOPEN2K8 || defined POSIX2008
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)
@@ -460,16 +482,22 @@ function void sync (void)
function {long int} sysconf (int)
function pid_t tcgetpgrp (int)
function int tcsetpgrp (int, pid_t)
+#ifndef POSIX
function int truncate (const char*, off_t)
+#endif
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/conform/data/wchar.h-data b/conform/data/wchar.h-data
index 0911f12e48..bf9e1a92e5 100644
--- a/conform/data/wchar.h-data
+++ b/conform/data/wchar.h-data
@@ -53,12 +53,12 @@ function wint_t towlower (wint_t)
function wint_t towupper (wint_t)
#endif
function wint_t ungetwc (wint_t, FILE*)
-function int vfwprintf (FILE*, const wchar_t*, va_list)
-function int vfwscanf (FILE*, const wchar_t*, va_list)
-function int vwprintf (const wchar_t*, va_list)
-function int vwscanf (const wchar_t*, va_list)
-function int vswprintf (wchar_t*, size_t, const wchar_t*, va_list)
-function int vswscanf (const wchar_t*, const wchar_t*, va_list)
+function int vfwprintf (FILE*, const wchar_t*, __gnuc_va_list)
+function int vfwscanf (FILE*, const wchar_t*, __gnuc_va_list)
+function int vwprintf (const wchar_t*, __gnuc_va_list)
+function int vwscanf (const wchar_t*, __gnuc_va_list)
+function int vswprintf (wchar_t*, size_t, const wchar_t*, __gnuc_va_list)
+function int vswscanf (const wchar_t*, const wchar_t*, __gnuc_va_list)
#if defined XOPEN2K8 || defined POSIX2008
function {wchar_t*} wcpcpy (wchar_t*, const wchar_t*)
function {wchar_t*} wcpncpy (wchar_t*, const wchar_t*, size_t)
@@ -102,7 +102,9 @@ function double wcstod (const wchar_t*, wchar_t**)
function {wchar_t*} wcstok (wchar_t*, const wchar_t*, wchar_t**)
function {long int} wcstol (const wchar_t*, wchar_t**, int)
function {unsigned long int} wcstoul (const wchar_t*, wchar_t**, int)
+#if defined UNIX98 || defined XOPEN2K
function {wchar_t*} wcswcs (const wchar_t*, const wchar_t*)
+#endif
#if !defined ISO && !defined POSIX && !defined POSIX2008
function int wcswidth (const wchar_t*, size_t)
#endif
diff --git a/conform/data/wordexp.h-data b/conform/data/wordexp.h-data
index 12eecbeee2..acbed7495e 100644
--- a/conform/data/wordexp.h-data
+++ b/conform/data/wordexp.h-data
@@ -14,7 +14,7 @@ constant WRDE_UNDEF
constant WRDE_BADCHAR
constant WRDE_CMDSUB
constant WRDE_NOSPACE
-#if defined XOPEN2K8 || defined POSIX2008
+#if !defined XOPEN2K8 && !defined POSIX2008
constant WRDE_NOSYS
#endif
constant WRDE_SYNTAX
diff --git a/include/features.h b/include/features.h
index c61e373498..7827cc2173 100644
--- a/include/features.h
+++ b/include/features.h
@@ -153,6 +153,8 @@
/* If _GNU_SOURCE was defined by the user, turn on all the other features. */
#ifdef _GNU_SOURCE
+# undef _ISOC95_SOURCE
+# define _ISOC95_SOURCE 1
# undef _ISOC99_SOURCE
# define _ISOC99_SOURCE 1
# undef _POSIX_SOURCE
@@ -233,6 +235,8 @@
#if (_POSIX_C_SOURCE - 0) >= 200112L
# define __USE_XOPEN2K 1
+# undef __USE_ISOC95
+# define __USE_ISOC95 1
# undef __USE_ISOC99
# define __USE_ISOC99 1
#endif
@@ -257,6 +261,8 @@
# endif
# define __USE_XOPEN2K 1
# define __USE_XOPEN2KXSI 1
+# undef __USE_ISOC95
+# define __USE_ISOC95 1
# undef __USE_ISOC99
# define __USE_ISOC99 1
# endif
diff --git a/io/fcntl.h b/io/fcntl.h
index d54fcf18b2..4eb003be46 100644
--- a/io/fcntl.h
+++ b/io/fcntl.h
@@ -38,10 +38,7 @@ __BEGIN_DECLS
# include <bits/types.h> /* For __mode_t and __dev_t. */
# define __need_timespec
# include <time.h>
-# ifndef __bits_stat_h_included
-# include <bits/stat.h>
-# define __bits_stat_h_included
-# endif
+# include <bits/stat.h>
# define S_IFMT __S_IFMT
# define S_IFDIR __S_IFDIR
diff --git a/io/sys/stat.h b/io/sys/stat.h
index de9b5e8064..733a927888 100644
--- a/io/sys/stat.h
+++ b/io/sys/stat.h
@@ -29,7 +29,7 @@
#include <bits/types.h> /* For __mode_t and __dev_t. */
#if defined __USE_XOPEN || defined __USE_XOPEN2K || defined __USE_MISC \
- || defined __USE_ATFILE
+ || defined __USE_ATFILE
# if defined __USE_XOPEN || defined __USE_XOPEN2K
# define __need_time_t
# endif
@@ -104,10 +104,7 @@ typedef __blksize_t blksize_t;
__BEGIN_DECLS
-#ifndef __bits_stat_h_included
-# include <bits/stat.h>
-# define __bits_stat_h_included
-#endif
+#include <bits/stat.h>
#if defined __USE_BSD || defined __USE_MISC || defined __USE_XOPEN
# define S_IFMT __S_IFMT
@@ -296,7 +293,7 @@ extern int lchmod (__const char *__file, __mode_t __mode)
#endif
/* Set file access permissions of the file FD is open on to MODE. */
-#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
+#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED || defined __USE_XOPEN2K8
extern int fchmod (int __fd, __mode_t __mode) __THROW;
#endif
diff --git a/posix/sys/wait.h b/posix/sys/wait.h
index bb98c00396..6d7f0684c1 100644
--- a/posix/sys/wait.h
+++ b/posix/sys/wait.h
@@ -32,7 +32,7 @@ __BEGIN_DECLS
#include <sys/resource.h>
/* These macros could also be defined in <stdlib.h>. */
-#if !defined _STDLIB_H || !defined __USE_XOPEN
+#if !defined _STDLIB_H || (!defined __USE_XOPEN && !defined __USE_XOPEN2K8)
/* This will define the `W*' macros for the flag
bits to `waitpid', `wait3', and `wait4'. */
# include <bits/waitflags.h>
diff --git a/posix/unistd.h b/posix/unistd.h
index b46a885afa..d8697553a7 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) || defined __USE_GNU
/* 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) || defined __USE_GNU
/* 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) || defined __USE_GNU
/* 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
diff --git a/stdlib/stdlib.h b/stdlib/stdlib.h
index 8669f35d76..75750205c8 100644
--- a/stdlib/stdlib.h
+++ b/stdlib/stdlib.h
@@ -497,8 +497,8 @@ extern void cfree (void *__ptr) __THROW;
# include <alloca.h>
#endif /* Use GNU, BSD, or misc. */
-#if (defined __USE_BSD || defined __USE_XOPEN_EXTENDED) \
- && !defined __USE_XOPEN2K
+#if ((defined __USE_BSD || defined __USE_XOPEN_EXTENDED) \
+ && !defined __USE_XOPEN2K) || defined __USE_GNU
/* Allocate SIZE bytes on a page boundary. The storage cannot be freed. */
extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
#endif
@@ -597,8 +597,8 @@ extern int clearenv (void) __THROW;
#endif
-#if (defined __USE_MISC || defined __USE_XOPEN_EXTENDED) \
- && !defined __USE_XOPEN2K
+#if ((defined __USE_MISC || defined __USE_XOPEN_EXTENDED) \
+ && !defined __USE_XOPEN2K) || defined __USE_GNU
/* Generate a unique temporary file name from TEMPLATE.
The last six characters of TEMPLATE must be "XXXXXX";
they are replaced with a string that makes the file name unique.
@@ -797,8 +797,8 @@ __END_NAMESPACE_C99
#endif
-#if (defined __USE_SVID || defined __USE_XOPEN_EXTENDED) \
- && !defined __USE_XOPEN2K
+#if ((defined __USE_SVID || defined __USE_XOPEN_EXTENDED) \
+ && !defined __USE_XOPEN2K) || defined __USE_GNU
/* Convert floating point numbers to strings. The returned values are
valid only until another call to the same function. */
diff --git a/sysdeps/mach/hurd/bits/stat.h b/sysdeps/mach/hurd/bits/stat.h
index 3770f071de..b64a658fbd 100644
--- a/sysdeps/mach/hurd/bits/stat.h
+++ b/sysdeps/mach/hurd/bits/stat.h
@@ -21,6 +21,9 @@
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
#include <bits/types.h>
/* NOTE: The size of this structure (32 ints) is known in
@@ -193,5 +196,7 @@ struct stat64
/* Default file creation mask (umask). */
#ifdef __USE_BSD
-#define CMASK 0022
+# define CMASK 0022
#endif
+
+#endif /* bits/stat.h */
diff --git a/sysdeps/unix/bsd/bits/stat.h b/sysdeps/unix/bsd/bits/stat.h
index 16e5c520fe..6eeab3b0ee 100644
--- a/sysdeps/unix/bsd/bits/stat.h
+++ b/sysdeps/unix/bsd/bits/stat.h
@@ -20,6 +20,9 @@
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
#include <bits/types.h>
/* Structure describing file characteristics. */
@@ -84,3 +87,5 @@ struct stat
#define __S_IREAD 0400 /* Read by owner. */
#define __S_IWRITE 0200 /* Write by owner. */
#define __S_IEXEC 0100 /* Execute by owner. */
+
+#endif /* bits/stat.h */
diff --git a/sysdeps/unix/sysv/bits/stat.h b/sysdeps/unix/sysv/bits/stat.h
index a860b9fe8a..2fb619a2e4 100644
--- a/sysdeps/unix/sysv/bits/stat.h
+++ b/sysdeps/unix/sysv/bits/stat.h
@@ -20,6 +20,9 @@
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
struct stat
{
short int st_dev;
@@ -63,3 +66,5 @@ struct stat
#define __S_IREAD 0400 /* Read by owner. */
#define __S_IWRITE 0200 /* Write by owner. */
#define __S_IEXEC 0100 /* Execute by owner. */
+
+#endif /* bits/stat.h */
diff --git a/sysdeps/unix/sysv/linux/bits/stat.h b/sysdeps/unix/sysv/linux/bits/stat.h
index e3f1970086..8ac3cd4726 100644
--- a/sysdeps/unix/sysv/linux/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/bits/stat.h
@@ -20,6 +20,9 @@
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
/* Versions of the `struct stat' data structure. */
#define _STAT_VER_LINUX_OLD 1
#define _STAT_VER_KERNEL 1
@@ -166,3 +169,5 @@ struct stat64
# define UTIME_NOW ((1l << 30) - 1l)
# define UTIME_OMIT ((1l << 30) - 2l)
#endif
+
+#endif /* bits/stat.h */
diff --git a/sysdeps/unix/sysv/linux/ia64/bits/stat.h b/sysdeps/unix/sysv/linux/ia64/bits/stat.h
index 98dadf9984..86acd27ae2 100644
--- a/sysdeps/unix/sysv/linux/ia64/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/ia64/bits/stat.h
@@ -20,6 +20,9 @@
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
/* Versions of the `struct stat' data structure. */
#define _STAT_VER_KERNEL 0
#define _STAT_VER_LINUX 1
@@ -143,3 +146,5 @@ struct stat64
# define UTIME_NOW ((1l << 30) - 1l)
# define UTIME_OMIT ((1l << 30) - 2l)
#endif
+
+#endif /* bits//stat.h */
diff --git a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
index 9027376979..6e4a55f87a 100644
--- a/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/powerpc/bits/stat.h
@@ -21,6 +21,9 @@
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
#include <bits/wordsize.h>
/* Versions of the `struct stat' data structure. */
@@ -270,3 +273,5 @@ struct stat64
# define UTIME_NOW ((1l << 30) - 1l)
# define UTIME_OMIT ((1l << 30) - 2l)
#endif
+
+#endif /* bits/stat.h */
diff --git a/sysdeps/unix/sysv/linux/s390/bits/stat.h b/sysdeps/unix/sysv/linux/s390/bits/stat.h
index 2cd5396eaa..9d62ad26f5 100644
--- a/sysdeps/unix/sysv/linux/s390/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/s390/bits/stat.h
@@ -20,6 +20,9 @@
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
#include <bits/wordsize.h>
#if __WORDSIZE == 64
@@ -259,3 +262,5 @@ struct stat64
# define UTIME_NOW ((1l << 30) - 1l)
# define UTIME_OMIT ((1l << 30) - 2l)
#endif
+
+#endif /* bits/stat.h */
diff --git a/sysdeps/unix/sysv/linux/sparc/bits/stat.h b/sysdeps/unix/sysv/linux/sparc/bits/stat.h
index 407ca2d7b5..eaab95a1cb 100644
--- a/sysdeps/unix/sysv/linux/sparc/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/sparc/bits/stat.h
@@ -20,6 +20,9 @@
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
/* Versions of the `struct stat' data structure. */
#define _STAT_VER_LINUX_OLD 1
#define _STAT_VER_KERNEL 1
@@ -167,3 +170,5 @@ struct stat64
# define UTIME_NOW ((1l << 30) - 1l)
# define UTIME_OMIT ((1l << 30) - 2l)
#endif
+
+#endif /* bits/stat.h */
diff --git a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
index cfc3f665dc..c7e4e1f0d4 100644
--- a/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
+++ b/sysdeps/unix/sysv/linux/x86_64/bits/stat.h
@@ -20,6 +20,9 @@
# error "Never include <bits/stat.h> directly; use <sys/stat.h> instead."
#endif
+#ifndef _BITS_STAT_H
+#define _BITS_STAT_H 1
+
/* Versions of the `struct stat' data structure. */
#define _STAT_VER_KERNEL 0
@@ -206,3 +209,5 @@ struct stat64
# define UTIME_NOW ((1l << 30) - 1l)
# define UTIME_OMIT ((1l << 30) - 2l)
#endif
+
+#endif /* bits/stat.h */
diff --git a/termios/termios.h b/termios/termios.h
index 9698b1fbd0..fdde6d3526 100644
--- a/termios/termios.h
+++ b/termios/termios.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991,92,93,94,96,97,98,99, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1991-1994,1996-1999,2003,2010 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
@@ -24,7 +24,7 @@
#define _TERMIOS_H 1
#include <features.h>
-#ifdef __USE_UNIX98
+#if defined __USE_UNIX98 || defined __USE_XOPEN2K8
/* We need `pid_t'. */
# include <bits/types.h>
# ifndef __pid_t_defined