summaryrefslogtreecommitdiff
path: root/posix
diff options
context:
space:
mode:
Diffstat (limited to 'posix')
-rw-r--r--posix/Makefile2
-rw-r--r--posix/confstr.c4
-rw-r--r--posix/getopt.c8
-rw-r--r--posix/getopt_init.c2
-rw-r--r--posix/sys/wait.h2
-rw-r--r--posix/unistd.h9
6 files changed, 15 insertions, 12 deletions
diff --git a/posix/Makefile b/posix/Makefile
index b7050867e4..3fbacdc918 100644
--- a/posix/Makefile
+++ b/posix/Makefile
@@ -26,7 +26,7 @@ headers := sys/utsname.h sys/times.h sys/wait.h sys/types.h unistd.h \
bits/posix1_lim.h bits/posix2_lim.h bits/posix_opt.h \
bits/local_lim.h tar.h bits/utsname.h bits/confname.h \
bits/waitflags.h bits/waitstatus.h sys/unistd.h sched.h \
- bits/sched.h re_comp.h wait.h
+ bits/sched.h re_comp.h wait.h bits/environments.h
distribute := confstr.h TESTS TESTS2C.sed testcases.h \
globtest.c globtest.sh
diff --git a/posix/confstr.c b/posix/confstr.c
index 3fabf1a883..c2b12dfd33 100644
--- a/posix/confstr.c
+++ b/posix/confstr.c
@@ -44,7 +44,9 @@ confstr (name, buf, len)
}
break;
+ case _CS_XBS5_ILP32_OFFBIG_CFLAGS:
case _CS_LFS_CFLAGS:
+#if defined _XBS5_ILP32_OFF32 && !defined _XBS5_ILP32_OFFBIG
/* Signal that we want the new ABI. */
{
static const char file_offset[] = "-D_FILE_OFFSET_BITS=64";
@@ -52,6 +54,7 @@ confstr (name, buf, len)
string_len = sizeof (file_offset);
}
break;
+#endif
case _CS_LFS_LINTFLAGS:
case _CS_LFS_LDFLAGS:
@@ -65,7 +68,6 @@ confstr (name, buf, len)
case _CS_XBS5_ILP32_OFF32_LDFLAGS:
case _CS_XBS5_ILP32_OFF32_LIBS:
case _CS_XBS5_ILP32_OFF32_LINTFLAGS:
- case _CS_XBS5_ILP32_OFFBIG_CFLAGS:
case _CS_XBS5_ILP32_OFFBIG_LDFLAGS:
case _CS_XBS5_ILP32_OFFBIG_LIBS:
case _CS_XBS5_ILP32_OFFBIG_LINTFLAGS:
diff --git a/posix/getopt.c b/posix/getopt.c
index 8311121385..3199925828 100644
--- a/posix/getopt.c
+++ b/posix/getopt.c
@@ -76,12 +76,6 @@
#endif
#endif
-#if defined (WINDOWS32) && !defined (__CYGWIN32__)
-/* It's not Unix, really. See? Capital letters. */
-#include <windows.h>
-#define getpid() GetCurrentProcessId()
-#endif
-
#ifndef _
/* This is for other GNU distributions with internationalized messages.
When compiling libc, the _ macro is predefined. */
@@ -259,8 +253,6 @@ static int nonoption_flags_len;
static int original_argc;
static char *const *original_argv;
-extern pid_t __libc_pid;
-
/* Make sure the environment variable bash 2.0 puts in the environment
is valid for the getopt call we must make sure that the ARGV passed
to getopt is that one passed to the process. */
diff --git a/posix/getopt_init.c b/posix/getopt_init.c
index 02165ee733..6619f2522b 100644
--- a/posix/getopt_init.c
+++ b/posix/getopt_init.c
@@ -53,7 +53,7 @@ __getopt_clean_environment (char **env)
/* Generate name of the environment variable. We must know the PID
and we must not use `sprintf'. */
- if (__libc_pid == 0)
+ if (__libc_pid == 0xf00baa)
__libc_pid = getpid ();
/* Construct "_<PID>_GNU_nonoption_argv_flags_=" string. */
diff --git a/posix/sys/wait.h b/posix/sys/wait.h
index bc2298f667..4774885ecf 100644
--- a/posix/sys/wait.h
+++ b/posix/sys/wait.h
@@ -60,7 +60,7 @@ typedef union
{
union wait *__uptr;
int *__iptr;
- } __WAIT_STATUS __attribute__ ((transparent_union));
+ } __WAIT_STATUS __attribute__ ((__transparent_union__));
# define __WAIT_STATUS_DEFN int *
#endif
diff --git a/posix/unistd.h b/posix/unistd.h
index f14e02d02b..2fbdae5652 100644
--- a/posix/unistd.h
+++ b/posix/unistd.h
@@ -77,6 +77,9 @@ __BEGIN_DECLS
are present. */
#define _XOPEN_ENH_I18N 1
+/* The legacy interfaces are also available. */
+#define _XOPEN_LEGACY 1
+
/* Get values of POSIX options:
@@ -122,6 +125,8 @@ __BEGIN_DECLS
_POSIX_POLL Implementation supports `poll' function.
_POSIX_SELECT Implementation supports `select' and `pselect'.
+ _XOPEN_REALTIME X/Open realtime support is available.
+ _XOPEN_REALTIME_THREADS X/Open realtime thread support is available.
_XOPEN_SHM Shared memory interface according to XPG4.2.
_XBS5_ILP32_OFF32 Implementation provides environment with 32-bit
@@ -162,6 +167,10 @@ __BEGIN_DECLS
#include <bits/posix_opt.h>
+/* Get the environment definitions from Unix98. */
+#ifdef __USE_UNIX98
+# include <bits/environments.h>
+#endif
/* Standard file descriptors. */
#define STDIN_FILENO 0 /* Standard input. */