summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@redhat.com>2010-01-11 10:31:49 +0100
committerAndreas Schwab <schwab@redhat.com>2010-01-11 10:31:49 +0100
commitc14a0516dbea2e1b794f9a09a8ea182fbe0dc349 (patch)
treeaea6ef619b1bb3ee704d5904f8209c33933c4822 /posix
parenta5683508bcdcfcbe8e486cbcdcaa3830d9ab22e8 (diff)
parent33780b6d332af9d94216eff880734be7748c2269 (diff)
Merge remote branch 'origin/master' into fedora/master
Diffstat (limited to 'posix')
-rw-r--r--posix/confstr.c214
-rw-r--r--posix/glob.h5
-rw-r--r--posix/sys/types.h11
-rw-r--r--posix/sys/wait.h8
4 files changed, 124 insertions, 114 deletions
diff --git a/posix/confstr.c b/posix/confstr.c
index 9aa4b5aebb..5553f4b28a 100644
--- a/posix/confstr.c
+++ b/posix/confstr.c
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,1996,1997,2000-2004,2009 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1996,1997,2000-2004,2009,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
@@ -58,52 +59,52 @@ confstr (name, buf, len)
string_len = 0;
#ifndef _POSIX_V7_ILP32_OFF32
- if (__sysconf (_SC_V7_ILP32_OFF32) > 0)
+ if (__sysconf (_SC_V7_ILP32_OFF32) > 0)
#endif
#if !defined _POSIX_V7_ILP32_OFF32 || _POSIX_V7_ILP32_OFF32 > 0
- {
- memcpy (restenvs + string_len, "POSIX_V7_ILP32_OFF32",
- sizeof "POSIX_V7_ILP32_OFF32" - 1);
- string_len += sizeof "POSIX_V7_ILP32_OFF32" - 1;
- }
+ {
+ memcpy (restenvs + string_len, "POSIX_V7_ILP32_OFF32",
+ sizeof "POSIX_V7_ILP32_OFF32" - 1);
+ string_len += sizeof "POSIX_V7_ILP32_OFF32" - 1;
+ }
#endif
#ifndef _POSIX_V7_ILP32_OFFBIG
- if (__sysconf (_SC_V7_ILP32_OFFBIG) > 0)
+ if (__sysconf (_SC_V7_ILP32_OFFBIG) > 0)
#endif
#if !defined _POSIX_V7_ILP32_OFFBIG || _POSIX_V7_ILP32_OFFBIG > 0
- {
- if (string_len)
- restenvs[string_len++] = '\n';
- memcpy (restenvs + string_len, "POSIX_V7_ILP32_OFFBIG",
- sizeof "POSIX_V7_ILP32_OFFBIG" - 1);
- string_len += sizeof "POSIX_V7_ILP32_OFFBIG" - 1;
- }
+ {
+ if (string_len)
+ restenvs[string_len++] = '\n';
+ memcpy (restenvs + string_len, "POSIX_V7_ILP32_OFFBIG",
+ sizeof "POSIX_V7_ILP32_OFFBIG" - 1);
+ string_len += sizeof "POSIX_V7_ILP32_OFFBIG" - 1;
+ }
#endif
#ifndef _POSIX_V7_LP64_OFF64
- if (__sysconf (_SC_V7_LP64_OFF64) > 0)
+ if (__sysconf (_SC_V7_LP64_OFF64) > 0)
#endif
#if !defined _POSIX_V7_LP64_OFF64 || _POSIX_V7_LP64_OFF64 > 0
- {
- if (string_len)
- restenvs[string_len++] = '\n';
- memcpy (restenvs + string_len, "POSIX_V7_LP64_OFF64",
- sizeof "POSIX_V7_LP64_OFF64" - 1);
- string_len += sizeof "POSIX_V7_LP64_OFF64" - 1;
- }
+ {
+ if (string_len)
+ restenvs[string_len++] = '\n';
+ memcpy (restenvs + string_len, "POSIX_V7_LP64_OFF64",
+ sizeof "POSIX_V7_LP64_OFF64" - 1);
+ string_len += sizeof "POSIX_V7_LP64_OFF64" - 1;
+ }
#endif
#ifndef _POSIX_V7_LPBIG_OFFBIG
- if (__sysconf (_SC_V7_LPBIG_OFFBIG) > 0)
+ if (__sysconf (_SC_V7_LPBIG_OFFBIG) > 0)
#endif
#if !defined _POSIX_V7_LPBIG_OFFBIG || _POSIX_V7_LPBIG_OFFBIG > 0
- {
- if (string_len)
- restenvs[string_len++] = '\n';
- memcpy (restenvs + string_len, "POSIX_V7_LPBIG_OFFBIG",
- sizeof "POSIX_V7_LPBIG_OFFBIG" - 1);
- string_len += sizeof "POSIX_V7_LPBIG_OFFBIG" - 1;
- }
-#endif
- restenvs[string_len++] = '\0';
+ {
+ if (string_len)
+ restenvs[string_len++] = '\n';
+ memcpy (restenvs + string_len, "POSIX_V7_LPBIG_OFFBIG",
+ sizeof "POSIX_V7_LPBIG_OFFBIG" - 1);
+ string_len += sizeof "POSIX_V7_LPBIG_OFFBIG" - 1;
+ }
+#endif
+ restenvs[string_len++] = '\0';
string = restenvs;
}
break;
@@ -121,52 +122,52 @@ confstr (name, buf, len)
string_len = 0;
#ifndef _POSIX_V6_ILP32_OFF32
- if (__sysconf (_SC_V6_ILP32_OFF32) > 0)
+ if (__sysconf (_SC_V6_ILP32_OFF32) > 0)
#endif
#if !defined _POSIX_V6_ILP32_OFF32 || _POSIX_V6_ILP32_OFF32 > 0
- {
- memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFF32",
- sizeof "POSIX_V6_ILP32_OFF32" - 1);
- string_len += sizeof "POSIX_V6_ILP32_OFF32" - 1;
- }
+ {
+ memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFF32",
+ sizeof "POSIX_V6_ILP32_OFF32" - 1);
+ string_len += sizeof "POSIX_V6_ILP32_OFF32" - 1;
+ }
#endif
#ifndef _POSIX_V6_ILP32_OFFBIG
- if (__sysconf (_SC_V6_ILP32_OFFBIG) > 0)
+ if (__sysconf (_SC_V6_ILP32_OFFBIG) > 0)
#endif
#if !defined _POSIX_V6_ILP32_OFFBIG || _POSIX_V6_ILP32_OFFBIG > 0
- {
- if (string_len)
- restenvs[string_len++] = '\n';
- memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFFBIG",
- sizeof "POSIX_V6_ILP32_OFFBIG" - 1);
- string_len += sizeof "POSIX_V6_ILP32_OFFBIG" - 1;
- }
+ {
+ if (string_len)
+ restenvs[string_len++] = '\n';
+ memcpy (restenvs + string_len, "POSIX_V6_ILP32_OFFBIG",
+ sizeof "POSIX_V6_ILP32_OFFBIG" - 1);
+ string_len += sizeof "POSIX_V6_ILP32_OFFBIG" - 1;
+ }
#endif
#ifndef _POSIX_V6_LP64_OFF64
- if (__sysconf (_SC_V6_LP64_OFF64) > 0)
+ if (__sysconf (_SC_V6_LP64_OFF64) > 0)
#endif
#if !defined _POSIX_V6_LP64_OFF64 || _POSIX_V6_LP64_OFF64 > 0
- {
- if (string_len)
- restenvs[string_len++] = '\n';
- memcpy (restenvs + string_len, "POSIX_V6_LP64_OFF64",
- sizeof "POSIX_V6_LP64_OFF64" - 1);
- string_len += sizeof "POSIX_V6_LP64_OFF64" - 1;
- }
+ {
+ if (string_len)
+ restenvs[string_len++] = '\n';
+ memcpy (restenvs + string_len, "POSIX_V6_LP64_OFF64",
+ sizeof "POSIX_V6_LP64_OFF64" - 1);
+ string_len += sizeof "POSIX_V6_LP64_OFF64" - 1;
+ }
#endif
#ifndef _POSIX_V6_LPBIG_OFFBIG
- if (__sysconf (_SC_V6_LPBIG_OFFBIG) > 0)
+ if (__sysconf (_SC_V6_LPBIG_OFFBIG) > 0)
#endif
#if !defined _POSIX_V6_LPBIG_OFFBIG || _POSIX_V6_LPBIG_OFFBIG > 0
- {
- if (string_len)
- restenvs[string_len++] = '\n';
- memcpy (restenvs + string_len, "POSIX_V6_LPBIG_OFFBIG",
- sizeof "POSIX_V6_LPBIG_OFFBIG" - 1);
- string_len += sizeof "POSIX_V6_LPBIG_OFFBIG" - 1;
- }
-#endif
- restenvs[string_len++] = '\0';
+ {
+ if (string_len)
+ restenvs[string_len++] = '\n';
+ memcpy (restenvs + string_len, "POSIX_V6_LPBIG_OFFBIG",
+ sizeof "POSIX_V6_LPBIG_OFFBIG" - 1);
+ string_len += sizeof "POSIX_V6_LPBIG_OFFBIG" - 1;
+ }
+#endif
+ restenvs[string_len++] = '\0';
string = restenvs;
}
break;
@@ -184,52 +185,52 @@ confstr (name, buf, len)
string_len = 0;
#ifndef _XBS5_ILP32_OFF32
- if (__sysconf (_SC_XBS5_ILP32_OFF32) > 0)
+ if (__sysconf (_SC_XBS5_ILP32_OFF32) > 0)
#endif
#if !defined _XBS5_ILP32_OFF32 || _XBS5_ILP32_OFF32 > 0
- {
- memcpy (restenvs + string_len, "XBS5_ILP32_OFF32",
- sizeof "XBS5_ILP32_OFF32" - 1);
- string_len += sizeof "XBS5_ILP32_OFF32" - 1;
- }
+ {
+ memcpy (restenvs + string_len, "XBS5_ILP32_OFF32",
+ sizeof "XBS5_ILP32_OFF32" - 1);
+ string_len += sizeof "XBS5_ILP32_OFF32" - 1;
+ }
#endif
#ifndef _XBS5_ILP32_OFFBIG
- if (__sysconf (_SC_XBS5_ILP32_OFFBIG) > 0)
+ if (__sysconf (_SC_XBS5_ILP32_OFFBIG) > 0)
#endif
#if !defined _XBS5_ILP32_OFFBIG || _XBS5_ILP32_OFFBIG > 0
- {
- if (string_len)
- restenvs[string_len++] = '\n';
- memcpy (restenvs + string_len, "XBS5_ILP32_OFFBIG",
- sizeof "XBS5_ILP32_OFFBIG" - 1);
- string_len += sizeof "XBS5_ILP32_OFFBIG" - 1;
- }
+ {
+ if (string_len)
+ restenvs[string_len++] = '\n';
+ memcpy (restenvs + string_len, "XBS5_ILP32_OFFBIG",
+ sizeof "XBS5_ILP32_OFFBIG" - 1);
+ string_len += sizeof "XBS5_ILP32_OFFBIG" - 1;
+ }
#endif
#ifndef _XBS5_LP64_OFF64
- if (__sysconf (_SC_XBS5_LP64_OFF64) > 0)
+ if (__sysconf (_SC_XBS5_LP64_OFF64) > 0)
#endif
#if !defined _XBS5_LP64_OFF64 || _XBS5_LP64_OFF64 > 0
- {
- if (string_len)
- restenvs[string_len++] = '\n';
- memcpy (restenvs + string_len, "XBS5_LP64_OFF64",
- sizeof "XBS5_LP64_OFF64" - 1);
- string_len += sizeof "XBS5_LP64_OFF64" - 1;
- }
+ {
+ if (string_len)
+ restenvs[string_len++] = '\n';
+ memcpy (restenvs + string_len, "XBS5_LP64_OFF64",
+ sizeof "XBS5_LP64_OFF64" - 1);
+ string_len += sizeof "XBS5_LP64_OFF64" - 1;
+ }
#endif
#ifndef _XBS5_LPBIG_OFFBIG
- if (__sysconf (_SC_XBS5_LPBIG_OFFBIG) > 0)
+ if (__sysconf (_SC_XBS5_LPBIG_OFFBIG) > 0)
#endif
#if !defined _XBS5_LPBIG_OFFBIG || _XBS5_LPBIG_OFFBIG > 0
- {
- if (string_len)
- restenvs[string_len++] = '\n';
- memcpy (restenvs + string_len, "XBS5_LPBIG_OFFBIG",
- sizeof "XBS5_LPBIG_OFFBIG" - 1);
- string_len += sizeof "XBS5_LPBIG_OFFBIG" - 1;
- }
-#endif
- restenvs[string_len++] = '\0';
+ {
+ if (string_len)
+ restenvs[string_len++] = '\n';
+ memcpy (restenvs + string_len, "XBS5_LPBIG_OFFBIG",
+ sizeof "XBS5_LPBIG_OFFBIG" - 1);
+ string_len += sizeof "XBS5_LPBIG_OFFBIG" - 1;
+ }
+#endif
+ restenvs[string_len++] = '\0';
string = restenvs;
}
break;
@@ -242,7 +243,7 @@ confstr (name, buf, len)
# error "__ILP32_OFF32_CFLAGS should not be defined"
# elif !defined _POSIX_V7_ILP32_OFF32
if (__sysconf (_SC_V7_ILP32_OFF32) < 0)
- break;
+ break;
# endif
string = __ILP32_OFF32_CFLAGS;
string_len = sizeof (__ILP32_OFF32_CFLAGS);
@@ -257,7 +258,7 @@ confstr (name, buf, len)
# error "__ILP32_OFFBIG_CFLAGS should not be defined"
# elif !defined _POSIX_V7_ILP32_OFFBIG
if (__sysconf (_SC_V7_ILP32_OFFBIG) < 0)
- break;
+ break;
# endif
string = __ILP32_OFFBIG_CFLAGS;
string_len = sizeof (__ILP32_OFFBIG_CFLAGS);
@@ -272,7 +273,7 @@ confstr (name, buf, len)
# error "__LP64_OFF64_CFLAGS should not be defined"
# elif !defined _POSIX_V7_LP64_OFF64
if (__sysconf (_SC_V7_LP64_OFF64) < 0)
- break;
+ break;
# endif
string = __LP64_OFF64_CFLAGS;
string_len = sizeof (__LP64_OFF64_CFLAGS);
@@ -287,7 +288,7 @@ confstr (name, buf, len)
# error "__ILP32_OFF32_LDFLAGS should not be defined"
# elif !defined _POSIX_V7_ILP32_OFF32
if (__sysconf (_SC_V7_ILP32_OFF32) < 0)
- break;
+ break;
# endif
string = __ILP32_OFF32_LDFLAGS;
string_len = sizeof (__ILP32_OFF32_LDFLAGS);
@@ -302,7 +303,7 @@ confstr (name, buf, len)
# error "__ILP32_OFFBIG_LDFLAGS should not be defined"
# elif !defined _POSIX_V7_ILP32_OFFBIG
if (__sysconf (_SC_V7_ILP32_OFFBIG) < 0)
- break;
+ break;
# endif
string = __ILP32_OFFBIG_LDFLAGS;
string_len = sizeof (__ILP32_OFFBIG_LDFLAGS);
@@ -317,7 +318,7 @@ confstr (name, buf, len)
# error "__LP64_OFF64_LDFLAGS should not be defined"
# elif !defined _POSIX_V7_LP64_OFF64
if (__sysconf (_SC_V7_LP64_OFF64) < 0)
- break;
+ break;
# endif
string = __LP64_OFF64_LDFLAGS;
string_len = sizeof (__LP64_OFF64_LDFLAGS);
@@ -402,6 +403,13 @@ confstr (name, buf, len)
return 0;
#endif
+ case _CS_V6_ENV:
+ case _CS_V7_ENV:
+ /* Maybe something else is needed in future. */
+ string = "POSIXLY_CORRECT=1";
+ string_len = sizeof ("POSIXLY_CORRECT=1");
+ break;
+
default:
__set_errno (EINVAL);
return 0;
diff --git a/posix/glob.h b/posix/glob.h
index 3d401f082c..89a1886b29 100644
--- a/posix/glob.h
+++ b/posix/glob.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1991,92,95-98,2000,2001,2004 Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1995-1998,2000,2001,2004,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
@@ -27,7 +28,7 @@ __BEGIN_DECLS
#ifndef __size_t
# if defined __GNUC__ && __GNUC__ >= 2
typedef __SIZE_TYPE__ __size_t;
-# ifdef __USE_XOPEN
+# if defined __USE_XOPEN || __USE_XOPEN2K8
typedef __SIZE_TYPE__ size_t;
# endif
# else
diff --git a/posix/sys/types.h b/posix/sys/types.h
index 04563a4abc..a7e9084e2e 100644
--- a/posix/sys/types.h
+++ b/posix/sys/types.h
@@ -1,5 +1,4 @@
-/* Copyright (C) 1991,1992,1994,1995,1996,1997,1998,1999,2000,2001,2002,2006
- Free Software Foundation, Inc.
+/* Copyright (C) 1991,1992,1994-2002,2006,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
@@ -101,7 +100,8 @@ typedef __pid_t pid_t;
# define __pid_t_defined
#endif
-#if (defined __USE_SVID || defined __USE_XOPEN) && !defined __id_t_defined
+#if (defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8) \
+ && !defined __id_t_defined
typedef __id_t id_t;
# define __id_t_defined
#endif
@@ -124,7 +124,7 @@ typedef __key_t key_t;
# define __key_t_defined
#endif
-#ifdef __USE_XOPEN
+#if defined __USE_XOPEN || defined __USE_XOPEN2K8
# define __need_clock_t
#endif
#define __need_time_t
@@ -224,7 +224,8 @@ typedef int register_t __attribute__ ((__mode__ (__word__)));
#endif /* Use BSD. */
-#if defined __USE_UNIX98 && !defined __blksize_t_defined
+#if (defined __USE_UNIX98 || defined __USE_XOPEN2K8) \
+ && !defined __blksize_t_defined
typedef __blksize_t blksize_t;
# define __blksize_t_defined
#endif
diff --git a/posix/sys/wait.h b/posix/sys/wait.h
index d9248426dc..bb98c00396 100644
--- a/posix/sys/wait.h
+++ b/posix/sys/wait.h
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005,2007,2009
+/* Copyright (C) 1991-1994,1996-2001,2003,2004,2005,2007,2009,2010
Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -45,7 +45,7 @@ __BEGIN_DECLS
# if defined __GNUC__ && !defined __cplusplus
# define __WAIT_INT(status) \
(__extension__ (((union { __typeof(status) __in; int __i; }) \
- { .__in = (status) }).__i))
+ { .__in = (status) }).__i))
# else
# define __WAIT_INT(status) (*(__const int *) &(status))
# endif
@@ -98,7 +98,7 @@ typedef union
#endif
/* The following values are used by the `waitid' function. */
-#if defined __USE_SVID || defined __USE_XOPEN
+#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
typedef enum
{
P_ALL, /* Wait for any child. */
@@ -138,7 +138,7 @@ extern __pid_t wait (__WAIT_STATUS __stat_loc);
__THROW. */
extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
-#if defined __USE_SVID || defined __USE_XOPEN
+#if defined __USE_SVID || defined __USE_XOPEN || defined __USE_XOPEN2K8
# define __need_siginfo_t
# include <bits/siginfo.h>
/* Wait for a childing matching IDTYPE and ID to change the status and