summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-05-26 23:37:38 +0000
committerUlrich Drepper <drepper@redhat.com>1999-05-26 23:37:38 +0000
commit958f238f3619373d3dbc106d3cda3c467b3419b1 (patch)
tree9d15d47658aeaae08ee7e5e5e9d4a63d034caa49
parent475e390e80a950a8746dc0b88341742dc99014e4 (diff)
Update.
1999-05-26 Ulrich Drepper <drepper@cygnus.com> * config.h.in: Add __LINUX_KERNEL_VERSION. * configure.in: Recognize --enable-kernel. * sysdeps/unix/sysv/linux/configure.in: Check for correct kernel headers if --enable-kernel is given and set __LINUX_KERNEL_VERSION appropriately. * sysdeps/unix/sysv/linux/init-first.c: If minimal kernel version is given perform runtime test. * sysdeps/unix/sysv/linux/kernel-features.h: New file. * sysdeps/unix/sysv/linux/getcwd.c: Elide compatibility code if minimal supported kernel is known to have the feature. * sysdeps/unix/sysv/linux/poll.c: Likewise. * sysdeps/unix/sysv/linux/pread.c: Likewise. * sysdeps/unix/sysv/linux/pread64.c: Likewise. * sysdeps/unix/sysv/linux/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/seteuid.c: Likewise. * sysdeps/unix/sysv/linux/sigaction.c: Likewise. * sysdeps/unix/sysv/linux/sigprocmask.c: Likewise. * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise. * sysdeps/unix/sysv/linux/testrtsig.h: Likewise. * sysdeps/unix/sysv/linux/i386/chown.c: Likewise. * sysdeps/unix/sysv/linux/i386/pread.c: Likewise. * sysdeps/unix/sysv/linux/i386/pread64.c: Likewise. * sysdeps/unix/sysv/linux/i386/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/i386/pwrite64.c: Likewise. * sysdeps/unix/sysv/linux/sysctl.c: Add __sysctl alias.
-rw-r--r--ChangeLog31
-rw-r--r--config.h.in3
-rwxr-xr-xconfigure456
-rw-r--r--configure.in7
-rw-r--r--sysdeps/unix/sysv/linux/configure33
-rw-r--r--sysdeps/unix/sysv/linux/configure.in27
-rw-r--r--sysdeps/unix/sysv/linux/getcwd.c45
-rw-r--r--sysdeps/unix/sysv/linux/i386/chown.c14
-rw-r--r--sysdeps/unix/sysv/linux/i386/pread.c17
-rw-r--r--sysdeps/unix/sysv/linux/i386/pread64.c18
-rw-r--r--sysdeps/unix/sysv/linux/i386/pwrite.c17
-rw-r--r--sysdeps/unix/sysv/linux/i386/pwrite64.c17
-rw-r--r--sysdeps/unix/sysv/linux/init-first.c74
-rw-r--r--sysdeps/unix/sysv/linux/kernel-features.h74
-rw-r--r--sysdeps/unix/sysv/linux/poll.c16
-rw-r--r--sysdeps/unix/sysv/linux/pread.c17
-rw-r--r--sysdeps/unix/sysv/linux/pread64.c17
-rw-r--r--sysdeps/unix/sysv/linux/pwrite.c17
-rw-r--r--sysdeps/unix/sysv/linux/pwrite64.c17
-rw-r--r--sysdeps/unix/sysv/linux/seteuid.c8
-rw-r--r--sysdeps/unix/sysv/linux/sigaction.c37
-rw-r--r--sysdeps/unix/sysv/linux/sigpending.c10
-rw-r--r--sysdeps/unix/sysv/linux/sigprocmask.c11
-rw-r--r--sysdeps/unix/sysv/linux/sigsuspend.c10
-rw-r--r--sysdeps/unix/sysv/linux/sysctl.c7
-rw-r--r--sysdeps/unix/sysv/linux/testrtsig.h8
26 files changed, 745 insertions, 263 deletions
diff --git a/ChangeLog b/ChangeLog
index f6f27f87ab..d6d413d68c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,34 @@
+1999-05-26 Ulrich Drepper <drepper@cygnus.com>
+
+ * config.h.in: Add __LINUX_KERNEL_VERSION.
+ * configure.in: Recognize --enable-kernel.
+ * sysdeps/unix/sysv/linux/configure.in: Check for correct kernel
+ headers if --enable-kernel is given and set __LINUX_KERNEL_VERSION
+ appropriately.
+ * sysdeps/unix/sysv/linux/init-first.c: If minimal kernel version is
+ given perform runtime test.
+
+ * sysdeps/unix/sysv/linux/kernel-features.h: New file.
+ * sysdeps/unix/sysv/linux/getcwd.c: Elide compatibility code if
+ minimal supported kernel is known to have the feature.
+ * sysdeps/unix/sysv/linux/poll.c: Likewise.
+ * sysdeps/unix/sysv/linux/pread.c: Likewise.
+ * sysdeps/unix/sysv/linux/pread64.c: Likewise.
+ * sysdeps/unix/sysv/linux/pwrite.c: Likewise.
+ * sysdeps/unix/sysv/linux/pwrite64.c: Likewise.
+ * sysdeps/unix/sysv/linux/seteuid.c: Likewise.
+ * sysdeps/unix/sysv/linux/sigaction.c: Likewise.
+ * sysdeps/unix/sysv/linux/sigprocmask.c: Likewise.
+ * sysdeps/unix/sysv/linux/sigsuspend.c: Likewise.
+ * sysdeps/unix/sysv/linux/testrtsig.h: Likewise.
+ * sysdeps/unix/sysv/linux/i386/chown.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/pread.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/pread64.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/pwrite.c: Likewise.
+ * sysdeps/unix/sysv/linux/i386/pwrite64.c: Likewise.
+
+ * sysdeps/unix/sysv/linux/sysctl.c: Add __sysctl alias.
+
1999-05-25 Ulrich Drepper <drepper@cygnus.com>
* sysdeps/posix/getcwd.c (__getcwd): Fix potential memory leaks.
diff --git a/config.h.in b/config.h.in
index dc1d5bc846..05826b6f6f 100644
--- a/config.h.in
+++ b/config.h.in
@@ -77,6 +77,9 @@
# define internal_function __attribute__ ((regparm (3), stdcall))
#endif
+/* Linux specific: minimum supported kernel version. */
+#undef __LINUX_KERNEL_VERSION
+
/*
*/
diff --git a/configure b/configure
index ef3e95819d..4b8265a1c2 100755
--- a/configure
+++ b/configure
@@ -12,7 +12,7 @@
# Guess values for system-dependent variables and create Makefiles.
-# Generated automatically using autoconf version 2.13
+# Generated automatically using autoconf version 2.14.1
# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
#
# This configure script is free software; the Free Software Foundation
@@ -63,6 +63,9 @@ ac_help="$ac_help
ac_help="$ac_help
--disable-force-install don't force installation of files from this package,
even if they are older than the installed files"
+ac_help="$ac_help
+ --enable-kernel=VERSION compile for copmatibility with kernel not older
+ than VERSION"
# Initialize some variables set by options.
# The variables have the same names as the options, with
@@ -385,7 +388,7 @@ EOF
verbose=yes ;;
-version | --version | --versio | --versi | --vers)
- echo "configure generated by autoconf version 2.13"
+ echo "configure generated by autoconf version 2.14.1"
exit 0 ;;
-with-* | --with-*)
@@ -545,7 +548,7 @@ done
if test -r "$cache_file"; then
echo "loading cache $cache_file"
- . $cache_file
+ test -f "$cache_file" && . $cache_file
else
echo "creating cache $cache_file"
> $cache_file
@@ -597,9 +600,9 @@ done
if test -z "$ac_aux_dir"; then
{ echo "configure: error: can not find install-sh or install.sh in scripts $srcdir/scripts" 1>&2; exit 1; }
fi
-ac_config_guess=$ac_aux_dir/config.guess
-ac_config_sub=$ac_aux_dir/config.sub
-ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
# This will get text that should go into config.make.
@@ -793,32 +796,53 @@ fi
-
-# Make sure we can run config.sub.
-if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
-else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+# Check whether --enable-kernel or --disable-kernel was given.
+if test "${enable_kernel+set}" = set; then
+ enableval="$enable_kernel"
+ minimum_kernel=$enableval
fi
+
+
echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:804: checking host system type" >&5
+echo "configure:809: checking host system type" >&5
+if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then
+
+# Make sure we can run config.sub.
+ if $ac_config_sub sun4 >/dev/null 2>&1; then :
+ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+ fi
-host_alias=$host
-case "$host_alias" in
-NONE)
- case $nonopt in
+ ac_cv_host_alias=$host
+ case "$ac_cv_host_alias" in
NONE)
- if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
- else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
- fi ;;
- *) host_alias=$nonopt ;;
- esac ;;
-esac
+ case $nonopt in
+ NONE)
+ if ac_cv_host_alias=`$ac_config_guess`; then :
+ else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+ fi ;;
+ *) ac_cv_host_alias=$nonopt ;;
+ esac ;;
+ esac
+
+ ac_cv_host=`$ac_config_sub $ac_cv_host_alias`
+ ac_cv_host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+ ac_cv_host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+ ac_cv_host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+else
+ echo $ac_n "(cached) $ac_c" 1>&6
+fi
+
+echo "$ac_t""$ac_cv_host" 1>&6
+
+host=$ac_cv_host
+host_alias=$ac_cv_host_alias
+host_cpu=$ac_cv_host_cpu
+host_vendor=$ac_cv_host_vendor
+host_os=$ac_cv_host_os
+
+
-host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
-host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$host" 1>&6
# The way shlib-versions is used to generate soversions.mk uses a
@@ -925,7 +949,7 @@ fi
# This can take a while to compute.
sysdep_dir=$srcdir/sysdeps
echo $ac_n "checking sysdep dirs""... $ac_c" 1>&6
-echo "configure:929: checking sysdep dirs" >&5
+echo "configure:953: checking sysdep dirs" >&5
# Make sco3.2v4 become sco3.2.4 and sunos4.1.1_U1 become sunos4.1.1.U1.
os="`echo $os | sed 's/\([0-9A-Z]\)[v_]\([0-9A-Z]\)/\1.\2/g'`"
@@ -1127,9 +1151,9 @@ echo "$ac_t""$default_sysnames" 1>&6
# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
# ./install, which can be erroneously created by make from ./install.sh.
echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1131: checking for a BSD compatible install" >&5
+echo "configure:1155: checking for a BSD compatible install" >&5
if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+if eval "test \"\${ac_cv_path_install+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":"
@@ -1147,6 +1171,10 @@ else
grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
:
+ elif test $ac_prog = install &&
+ grep pwplus $ac_dir/$ac_prog >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
else
ac_cv_path_install="$ac_dir/$ac_prog -c"
break 2
@@ -1175,7 +1203,7 @@ echo "$ac_t""$INSTALL" 1>&6
# It thinks the first close brace ends the variable substitution.
test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}'
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
@@ -1184,8 +1212,8 @@ if test "$INSTALL" = "${srcdir}/install-sh -c"; then
INSTALL='\$(..)./install-sh -c'
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:1188: checking whether ln -s works" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+echo "configure:1216: checking whether ln -s works" >&5
+if eval "test \"\${ac_cv_prog_LN_S+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
rm -f conftestdata
@@ -1206,23 +1234,45 @@ fi
# These programs are version sensitive.
+
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1211: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
+echo "configure:1240: checking build system type" >&5
+if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
+
+# Make sure we can run config.sub.
+ if $ac_config_sub sun4 >/dev/null 2>&1; then :
+ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+ fi
+
+ ac_cv_build_alias=$build
+ case "$ac_cv_build_alias" in
+ NONE)
+ case $nonopt in
+ NONE)
+ ac_cv_build_alias=$host_alias ;;
+
+ *) ac_cv_build_alias=$nonopt ;;
+ esac ;;
+ esac
+
+ ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
+ ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+ ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+ ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+else
+ echo $ac_n "(cached) $ac_c" 1>&6
+fi
+
+echo "$ac_t""$ac_cv_build" 1>&6
+
+build=$ac_cv_build
+build_alias=$ac_cv_build_alias
+build_cpu=$ac_cv_build_cpu
+build_vendor=$ac_cv_build_vendor
+build_os=$ac_cv_build_os
+
+
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
if test $host != $build; then
ac_tool_prefix=${host_alias}-
@@ -1235,8 +1285,8 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1239: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+echo "configure:1289: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_CC+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$CC"; then
@@ -1269,7 +1319,7 @@ if test -z "$CC"; then
else
# Found it, now check the version.
echo $ac_n "checking version of $CC""... $ac_c" 1>&6
-echo "configure:1273: checking version of $CC" >&5
+echo "configure:1323: checking version of $CC" >&5
ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustp-]*[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
@@ -1289,8 +1339,8 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1293: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_MAKE'+set}'`\" = set"; then
+echo "configure:1343: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_MAKE+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$MAKE"; then
@@ -1323,7 +1373,7 @@ if test -z "$MAKE"; then
else
# Found it, now check the version.
echo $ac_n "checking version of $MAKE""... $ac_c" 1>&6
-echo "configure:1327: checking version of $MAKE" >&5
+echo "configure:1377: checking version of $MAKE" >&5
ac_prog_version=`$MAKE --version 2>&1 | sed -n 's/^.*version \([0-9][0-9.]*\), by.*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
@@ -1344,8 +1394,8 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1348: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_MSGFMT'+set}'`\" = set"; then
+echo "configure:1398: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_MSGFMT+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$MSGFMT"; then
@@ -1378,7 +1428,7 @@ if test -z "$MSGFMT"; then
else
# Found it, now check the version.
echo $ac_n "checking version of $MSGFMT""... $ac_c" 1>&6
-echo "configure:1382: checking version of $MSGFMT" >&5
+echo "configure:1432: checking version of $MSGFMT" >&5
ac_prog_version=`$MSGFMT --version 2>&1 | sed -n 's/^.*GNU gettext.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
@@ -1398,8 +1448,8 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1402: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_MAKEINFO'+set}'`\" = set"; then
+echo "configure:1452: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_MAKEINFO+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$MAKEINFO"; then
@@ -1432,7 +1482,7 @@ if test -z "$MAKEINFO"; then
else
# Found it, now check the version.
echo $ac_n "checking version of $MAKEINFO""... $ac_c" 1>&6
-echo "configure:1436: checking version of $MAKEINFO" >&5
+echo "configure:1486: checking version of $MAKEINFO" >&5
ac_prog_version=`$MAKEINFO --version 2>&1 | sed -n 's/^.*GNU texinfo.* \([0-9][0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
@@ -1461,8 +1511,8 @@ test -n "$aux_missing" && echo "configure: warning:
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1465: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_works'+set}'`\" = set"; then
+echo "configure:1515: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+if eval "test \"\${ac_cv_prog_cc_works+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1475,12 +1525,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1479 "configure"
+#line 1529 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1484: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
ac_cv_prog_cc_works=yes
# If we can't run a trivial program, we are probably using a cross compiler.
if (./conftest; exit) 2>/dev/null; then
@@ -1511,8 +1561,8 @@ else
cross_linkable=yes
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
-echo "configure:1515: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_cc_cross'+set}'`\" = set"; then
+echo "configure:1565: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+if eval "test \"\${ac_cv_prog_cc_cross+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
:
@@ -1523,8 +1573,8 @@ echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
cross_compiling=$ac_cv_prog_cc_cross
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1527: checking whether we are using GNU C" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+echo "configure:1577: checking whether we are using GNU C" >&5
+if eval "test \"\${ac_cv_prog_gcc+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
@@ -1532,7 +1582,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1536: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1586: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -1544,23 +1594,45 @@ if test $ac_cv_prog_gcc != yes; then
{ echo "configure: error: GNU libc must be compiled using GNU CC" 1>&2; exit 1; }
fi
+
echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:1549: checking build system type" >&5
-
-build_alias=$build
-case "$build_alias" in
-NONE)
- case $nonopt in
- NONE) build_alias=$host_alias ;;
- *) build_alias=$nonopt ;;
- esac ;;
-esac
+echo "configure:1600: checking build system type" >&5
+if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then
+
+# Make sure we can run config.sub.
+ if $ac_config_sub sun4 >/dev/null 2>&1; then :
+ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+ fi
+
+ ac_cv_build_alias=$build
+ case "$ac_cv_build_alias" in
+ NONE)
+ case $nonopt in
+ NONE)
+ ac_cv_build_alias=$host_alias ;;
+
+ *) ac_cv_build_alias=$nonopt ;;
+ esac ;;
+ esac
+
+ ac_cv_build=`$ac_config_sub $ac_cv_build_alias`
+ ac_cv_build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+ ac_cv_build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+ ac_cv_build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+else
+ echo $ac_n "(cached) $ac_c" 1>&6
+fi
+
+echo "$ac_t""$ac_cv_build" 1>&6
+
+build=$ac_cv_build
+build_alias=$ac_cv_build_alias
+build_cpu=$ac_cv_build_cpu
+build_vendor=$ac_cv_build_vendor
+build_os=$ac_cv_build_os
+
+
-build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
-build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
-build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
-build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
-echo "$ac_t""$build" 1>&6
if test $host != $build; then
for ac_prog in gcc cc
@@ -1568,8 +1640,8 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1572: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_BUILD_CC'+set}'`\" = set"; then
+echo "configure:1644: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_BUILD_CC+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$BUILD_CC"; then
@@ -1600,13 +1672,13 @@ done
fi
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1604: checking how to run the C preprocessor" >&5
+echo "configure:1676: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
fi
if test -z "$CPP"; then
-if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+if eval "test \"\${ac_cv_prog_CPP+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# This must be in double quotes, not single quotes, because CPP may get
@@ -1615,13 +1687,13 @@ else
# On the NeXT, cc -E runs the code through the compiler's parser,
# not just through cpp.
cat > conftest.$ac_ext <<EOF
-#line 1619 "configure"
+#line 1691 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1625: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1697: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1632,13 +1704,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1636 "configure"
+#line 1708 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1642: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1714: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1649,13 +1721,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1653 "configure"
+#line 1725 "configure"
#include "confdefs.h"
#include <assert.h>
Syntax Error
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1659: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
if test -z "$ac_err"; then
:
@@ -1698,8 +1770,8 @@ if test $RANLIB = ranlib; then
# Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ac_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1702: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+echo "configure:1774: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
@@ -1730,8 +1802,8 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1734: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+echo "configure:1806: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_RANLIB+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$RANLIB"; then
@@ -1767,8 +1839,8 @@ fi
# Determine whether we are using GNU binutils.
echo $ac_n "checking whether $AS is GNU as""... $ac_c" 1>&6
-echo "configure:1771: checking whether $AS is GNU as" >&5
-if eval "test \"`echo '$''{'libc_cv_prog_as_gnu'+set}'`\" = set"; then
+echo "configure:1843: checking whether $AS is GNU as" >&5
+if eval "test \"\${libc_cv_prog_as_gnu+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Most GNU programs take a -v and spit out some text including
@@ -1786,8 +1858,8 @@ rm -f a.out
gnu_as=$libc_cv_prog_as_gnu
echo $ac_n "checking whether $LD is GNU ld""... $ac_c" 1>&6
-echo "configure:1790: checking whether $LD is GNU ld" >&5
-if eval "test \"`echo '$''{'libc_cv_prog_ld_gnu'+set}'`\" = set"; then
+echo "configure:1862: checking whether $LD is GNU ld" >&5
+if eval "test \"\${libc_cv_prog_ld_gnu+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
# Most GNU programs take a -v and spit out some text including
@@ -1806,8 +1878,8 @@ gnu_ld=$libc_cv_prog_ld_gnu
# Extract the first word of "${ac_tool_prefix}mig", so it can be a program name with args.
set dummy ${ac_tool_prefix}mig; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1810: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_MIG'+set}'`\" = set"; then
+echo "configure:1882: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_MIG+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$MIG"; then
@@ -1847,8 +1919,8 @@ fi
# check if ranlib is necessary
echo $ac_n "checking whether ranlib is necessary""... $ac_c" 1>&6
-echo "configure:1851: checking whether ranlib is necessary" >&5
-if eval "test \"`echo '$''{'libc_cv_ranlib_necessary'+set}'`\" = set"; then
+echo "configure:1923: checking whether ranlib is necessary" >&5
+if eval "test \"\${libc_cv_ranlib_necessary+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
@@ -1881,7 +1953,7 @@ fi
# - two terminals occur directly after each other
# - the path contains an element with a dot in it
echo $ac_n "checking LD_LIBRARY_PATH variable""... $ac_c" 1>&6
-echo "configure:1885: checking LD_LIBRARY_PATH variable" >&5
+echo "configure:1957: checking LD_LIBRARY_PATH variable" >&5
case ${LD_LIBRARY_PATH} in
[:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
ld_library_path_setting="contains current directory"
@@ -1901,8 +1973,8 @@ fi
# Extract the first word of "bash", so it can be a program name with args.
set dummy bash; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1905: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_BASH'+set}'`\" = set"; then
+echo "configure:1977: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_path_BASH+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$BASH" in
@@ -1947,8 +2019,8 @@ if test "$BASH" = no; then
# Extract the first word of "ksh", so it can be a program name with args.
set dummy ksh; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1951: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_KSH'+set}'`\" = set"; then
+echo "configure:2023: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_path_KSH+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$KSH" in
@@ -1997,8 +2069,8 @@ do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2001: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then
+echo "configure:2073: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_prog_AWK+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test -n "$AWK"; then
@@ -2029,8 +2101,8 @@ done
# Extract the first word of "perl", so it can be a program name with args.
set dummy perl; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2033: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_PERL'+set}'`\" = set"; then
+echo "configure:2105: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_path_PERL+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$PERL" in
@@ -2066,8 +2138,8 @@ fi
# Extract the first word of "install-info", so it can be a program name with args.
set dummy install-info; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2070: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_INSTALL_INFO'+set}'`\" = set"; then
+echo "configure:2142: checking for $ac_word" >&5
+if eval "test \"\${ac_cv_path_INSTALL_INFO+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
case "$INSTALL_INFO" in
@@ -2102,8 +2174,8 @@ fi
if test "$INSTALL_INFO" != "no"; then
echo $ac_n "checking for old Debian install-info""... $ac_c" 1>&6
-echo "configure:2106: checking for old Debian install-info" >&5
-if eval "test \"`echo '$''{'libc_cv_old_debian_install_info'+set}'`\" = set"; then
+echo "configure:2178: checking for old Debian install-info" >&5
+if eval "test \"\${libc_cv_old_debian_install_info+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
mkdir conftest.d
@@ -2135,8 +2207,8 @@ fi
echo $ac_n "checking for signed size_t type""... $ac_c" 1>&6
-echo "configure:2139: checking for signed size_t type" >&5
-if eval "test \"`echo '$''{'libc_cv_signed_size_t'+set}'`\" = set"; then
+echo "configure:2211: checking for signed size_t type" >&5
+if eval "test \"\${libc_cv_signed_size_t+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
echo '#include <stddef.h>
@@ -2159,12 +2231,12 @@ EOF
fi
echo $ac_n "checking for libc-friendly stddef.h""... $ac_c" 1>&6
-echo "configure:2163: checking for libc-friendly stddef.h" >&5
-if eval "test \"`echo '$''{'libc_cv_friendly_stddef'+set}'`\" = set"; then
+echo "configure:2235: checking for libc-friendly stddef.h" >&5
+if eval "test \"\${libc_cv_friendly_stddef+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2168 "configure"
+#line 2240 "configure"
#include "confdefs.h"
#define __need_size_t
#define __need_wchar_t
@@ -2179,7 +2251,7 @@ size_t size; wchar_t wchar;
if (&size == NULL || &wchar == NULL) abort ();
; return 0; }
EOF
-if { (eval echo configure:2183: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2255: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_friendly_stddef=yes
else
@@ -2198,8 +2270,8 @@ override stddef.h = # The installed <stddef.h> seems to be libc-friendly."
fi
echo $ac_n "checking whether we need to use -P to assemble .S files""... $ac_c" 1>&6
-echo "configure:2202: checking whether we need to use -P to assemble .S files" >&5
-if eval "test \"`echo '$''{'libc_cv_need_minus_P'+set}'`\" = set"; then
+echo "configure:2274: checking whether we need to use -P to assemble .S files" >&5
+if eval "test \"\${libc_cv_need_minus_P+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.S <<EOF
@@ -2221,8 +2293,8 @@ asm-CPPFLAGS = -P # The assembler can't grok cpp's # line directives."
fi
echo $ac_n "checking for assembler global-symbol directive""... $ac_c" 1>&6
-echo "configure:2225: checking for assembler global-symbol directive" >&5
-if eval "test \"`echo '$''{'libc_cv_asm_global_directive'+set}'`\" = set"; then
+echo "configure:2297: checking for assembler global-symbol directive" >&5
+if eval "test \"\${libc_cv_asm_global_directive+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
libc_cv_asm_global_directive=UNKNOWN
@@ -2251,8 +2323,8 @@ EOF
fi
echo $ac_n "checking for .set assembler directive""... $ac_c" 1>&6
-echo "configure:2255: checking for .set assembler directive" >&5
-if eval "test \"`echo '$''{'libc_cv_asm_set_directive'+set}'`\" = set"; then
+echo "configure:2327: checking for .set assembler directive" >&5
+if eval "test \"\${libc_cv_asm_set_directive+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.s <<EOF
@@ -2285,8 +2357,8 @@ EOF
fi
echo $ac_n "checking for .symver assembler directive""... $ac_c" 1>&6
-echo "configure:2289: checking for .symver assembler directive" >&5
-if eval "test \"`echo '$''{'libc_cv_asm_symver_directive'+set}'`\" = set"; then
+echo "configure:2361: checking for .symver assembler directive" >&5
+if eval "test \"\${libc_cv_asm_symver_directive+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.s <<EOF
@@ -2304,8 +2376,8 @@ fi
echo "$ac_t""$libc_cv_asm_symver_directive" 1>&6
echo $ac_n "checking for ld --version-script""... $ac_c" 1>&6
-echo "configure:2308: checking for ld --version-script" >&5
-if eval "test \"`echo '$''{'libc_cv_ld_version_script_option'+set}'`\" = set"; then
+echo "configure:2380: checking for ld --version-script" >&5
+if eval "test \"\${libc_cv_ld_version_script_option+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
if test $libc_cv_asm_symver_directive = yes; then
@@ -2327,7 +2399,7 @@ EOF
if { ac_try='${CC-cc} $CFLAGS -shared -o conftest.so conftest.o
-nostartfiles -nostdlib
-Wl,--version-script,conftest.map
- 1>&5'; { (eval echo configure:2331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
+ 1>&5'; { (eval echo configure:2403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
then
libc_cv_ld_version_script_option=yes
else
@@ -2365,15 +2437,15 @@ if test $VERSIONING = no; then
fi
if test $elf = yes; then
echo $ac_n "checking for .previous assembler directive""... $ac_c" 1>&6
-echo "configure:2369: checking for .previous assembler directive" >&5
-if eval "test \"`echo '$''{'libc_cv_asm_previous_directive'+set}'`\" = set"; then
+echo "configure:2441: checking for .previous assembler directive" >&5
+if eval "test \"\${libc_cv_asm_previous_directive+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.s <<EOF
.section foo_section
.previous
EOF
- if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2449: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_asm_previous_directive=yes
else
libc_cv_asm_previous_directive=no
@@ -2389,15 +2461,15 @@ EOF
else
echo $ac_n "checking for .popsection assembler directive""... $ac_c" 1>&6
-echo "configure:2393: checking for .popsection assembler directive" >&5
-if eval "test \"`echo '$''{'libc_cv_asm_popsection_directive'+set}'`\" = set"; then
+echo "configure:2465: checking for .popsection assembler directive" >&5
+if eval "test \"\${libc_cv_asm_popsection_directive+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.s <<EOF
.pushsection foo_section
.popsection
EOF
- if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='${CC-cc} -c $CFLAGS conftest.s 1>&5'; { (eval echo configure:2473: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_asm_popsection_directive=yes
else
libc_cv_asm_popsection_directive=no
@@ -2417,12 +2489,12 @@ fi
if test $elf != yes; then
echo $ac_n "checking for .init and .fini sections""... $ac_c" 1>&6
-echo "configure:2421: checking for .init and .fini sections" >&5
-if eval "test \"`echo '$''{'libc_cv_have_initfini'+set}'`\" = set"; then
+echo "configure:2493: checking for .init and .fini sections" >&5
+if eval "test \"\${libc_cv_have_initfini+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2426 "configure"
+#line 2498 "configure"
#include "confdefs.h"
int main() {
@@ -2431,7 +2503,7 @@ asm (".section .init");
asm (".text");
; return 0; }
EOF
-if { (eval echo configure:2435: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_have_initfini=yes
else
@@ -2459,19 +2531,19 @@ if test $elf = yes; then
else
if test $ac_cv_prog_cc_works = yes; then
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
-echo "configure:2463: checking for _ prefix on C symbol names" >&5
-if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
+echo "configure:2535: checking for _ prefix on C symbol names" >&5
+if eval "test \"\${libc_cv_asm_underscores+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2468 "configure"
+#line 2540 "configure"
#include "confdefs.h"
asm ("_glibc_foobar:");
int main() {
glibc_foobar ();
; return 0; }
EOF
-if { (eval echo configure:2475: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2547: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
libc_cv_asm_underscores=yes
else
@@ -2486,17 +2558,17 @@ fi
echo "$ac_t""$libc_cv_asm_underscores" 1>&6
else
echo $ac_n "checking for _ prefix on C symbol names""... $ac_c" 1>&6
-echo "configure:2490: checking for _ prefix on C symbol names" >&5
-if eval "test \"`echo '$''{'libc_cv_asm_underscores'+set}'`\" = set"; then
+echo "configure:2562: checking for _ prefix on C symbol names" >&5
+if eval "test \"\${libc_cv_asm_underscores+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2495 "configure"
+#line 2567 "configure"
#include "confdefs.h"
void underscore_test(void) {
return; }
EOF
-if { (eval echo configure:2500: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if grep _underscore_test conftest* >/dev/null; then
rm -f conftest*
libc_cv_asm_underscores=yes
@@ -2528,8 +2600,8 @@ if test $elf = yes; then
fi
echo $ac_n "checking for assembler .weak directive""... $ac_c" 1>&6
-echo "configure:2532: checking for assembler .weak directive" >&5
-if eval "test \"`echo '$''{'libc_cv_asm_weak_directive'+set}'`\" = set"; then
+echo "configure:2604: checking for assembler .weak directive" >&5
+if eval "test \"\${libc_cv_asm_weak_directive+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.s <<EOF
@@ -2551,8 +2623,8 @@ echo "$ac_t""$libc_cv_asm_weak_directive" 1>&6
if test $libc_cv_asm_weak_directive = no; then
echo $ac_n "checking for assembler .weakext directive""... $ac_c" 1>&6
-echo "configure:2555: checking for assembler .weakext directive" >&5
-if eval "test \"`echo '$''{'libc_cv_asm_weakext_directive'+set}'`\" = set"; then
+echo "configure:2627: checking for assembler .weakext directive" >&5
+if eval "test \"\${libc_cv_asm_weakext_directive+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.s <<EOF
@@ -2589,8 +2661,8 @@ EOF
fi
echo $ac_n "checking for ld --no-whole-archive""... $ac_c" 1>&6
-echo "configure:2593: checking for ld --no-whole-archive" >&5
-if eval "test \"`echo '$''{'libc_cv_ld_no_whole_archive'+set}'`\" = set"; then
+echo "configure:2665: checking for ld --no-whole-archive" >&5
+if eval "test \"\${libc_cv_ld_no_whole_archive+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<\EOF
@@ -2600,7 +2672,7 @@ __throw () {}
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles -Wl,--no-whole-archive
- -o conftest conftest.c 1>&5'; { (eval echo configure:2604: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c 1>&5'; { (eval echo configure:2676: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_ld_no_whole_archive=yes
else
libc_cv_ld_no_whole_archive=no
@@ -2614,8 +2686,8 @@ if test $libc_cv_ld_no_whole_archive = yes; then
fi
echo $ac_n "checking for gcc -fexceptions""... $ac_c" 1>&6
-echo "configure:2618: checking for gcc -fexceptions" >&5
-if eval "test \"`echo '$''{'libc_cv_gcc_exceptions'+set}'`\" = set"; then
+echo "configure:2690: checking for gcc -fexceptions" >&5
+if eval "test \"\${libc_cv_gcc_exceptions+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<\EOF
@@ -2625,7 +2697,7 @@ __throw () {}
EOF
if { ac_try='${CC-cc} $CFLAGS
-nostdlib -nostartfiles -fexceptions
- -o conftest conftest.c 1>&5'; { (eval echo configure:2629: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c 1>&5'; { (eval echo configure:2701: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_exceptions=yes
else
libc_cv_gcc_exceptions=no
@@ -2640,14 +2712,14 @@ fi
if test "$base_machine" = alpha ; then
echo $ac_n "checking for function ..ng prefix""... $ac_c" 1>&6
-echo "configure:2644: checking for function ..ng prefix" >&5
-if eval "test \"`echo '$''{'libc_cv_gcc_alpha_ng_prefix'+set}'`\" = set"; then
+echo "configure:2716: checking for function ..ng prefix" >&5
+if eval "test \"\${libc_cv_gcc_alpha_ng_prefix+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<\EOF
foo () { }
EOF
-if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo..ng" > /dev/null'; { (eval echo configure:2651: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
+if { ac_try='${CC-cc} -S conftest.c -o - | fgrep "\$foo..ng" > /dev/null'; { (eval echo configure:2723: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; };
then
libc_cv_gcc_alpha_ng_prefix=yes
else
@@ -2674,19 +2746,19 @@ if test "$host_cpu" = powerpc ; then
# Check for a bug present in at least versions 2.8.x of GCC
# and versions 1.0.x of EGCS.
echo $ac_n "checking whether clobbering cr0 causes problems""... $ac_c" 1>&6
-echo "configure:2678: checking whether clobbering cr0 causes problems" >&5
-if eval "test \"`echo '$''{'libc_cv_c_asmcr0_bug'+set}'`\" = set"; then
+echo "configure:2750: checking whether clobbering cr0 causes problems" >&5
+if eval "test \"\${libc_cv_c_asmcr0_bug+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 2683 "configure"
+#line 2755 "configure"
#include "confdefs.h"
int tester(int x) { asm ("" : : : "cc"); return x & 123; }
int main() {
; return 0; }
EOF
-if { (eval echo configure:2690: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2762: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libc_cv_c_asmcr0_bug='no'
else
@@ -2708,12 +2780,12 @@ fi
fi
echo $ac_n "checking for DWARF2 unwind info support""... $ac_c" 1>&6
-echo "configure:2712: checking for DWARF2 unwind info support" >&5
-if eval "test \"`echo '$''{'libc_cv_gcc_dwarf2_unwind_info'+set}'`\" = set"; then
+echo "configure:2784: checking for DWARF2 unwind info support" >&5
+if eval "test \"\${libc_cv_gcc_dwarf2_unwind_info+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
-#line 2717 "configure"
+#line 2789 "configure"
static char __EH_FRAME_BEGIN__;
_start ()
{
@@ -2740,7 +2812,7 @@ __bzero () {}
EOF
if { ac_try='${CC-cc} $CFLAGS -DCHECK__register_frame_info
-nostdlib -nostartfiles
- -o conftest conftest.c -lgcc >&5'; { (eval echo configure:2744: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c -lgcc >&5'; { (eval echo configure:2816: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_dwarf2_unwind_info=static
else
libc_cv_gcc_dwarf2_unwind_info=no
@@ -2748,7 +2820,7 @@ fi
if test $libc_cv_gcc_dwarf2_unwind_info = no; then
if { ac_try='${CC-cc} $CFLAGS -DCHECK__register_frame
-nostdlib -nostartfiles
- -o conftest conftest.c -lgcc >&5'; { (eval echo configure:2752: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c -lgcc >&5'; { (eval echo configure:2824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_dwarf2_unwind_info=yes
else
libc_cv_gcc_dwarf2_unwind_info=no
@@ -2778,12 +2850,12 @@ EOF
esac
echo $ac_n "checking for __builtin_expect""... $ac_c" 1>&6
-echo "configure:2782: checking for __builtin_expect" >&5
-if eval "test \"`echo '$''{'libc_cv_gcc_builtin_expect'+set}'`\" = set"; then
+echo "configure:2854: checking for __builtin_expect" >&5
+if eval "test \"\${libc_cv_gcc_builtin_expect+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.c <<EOF
-#line 2787 "configure"
+#line 2859 "configure"
int foo (int a)
{
a = __builtin_expect (a, 10);
@@ -2791,7 +2863,7 @@ int foo (int a)
}
EOF
if { ac_try='${CC-cc} $CFLAGS -nostdlib -nostartfiles
- -o conftest conftest.c -lgcc >&5'; { (eval echo configure:2795: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ -o conftest conftest.c -lgcc >&5'; { (eval echo configure:2867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
libc_cv_gcc_builtin_expect=yes
else
libc_cv_gcc_builtin_expect=no
@@ -2852,8 +2924,8 @@ if test "$uname" = "sysdeps/generic"; then
fi
echo $ac_n "checking OS release for uname""... $ac_c" 1>&6
-echo "configure:2856: checking OS release for uname" >&5
-if eval "test \"`echo '$''{'libc_cv_uname_release'+set}'`\" = set"; then
+echo "configure:2928: checking OS release for uname" >&5
+if eval "test \"\${libc_cv_uname_release+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
kernel_release=`echo "$kernel_id" | sed 's/^[^0-9.]*\([0-9.]*\).*$/\1/'`
@@ -2874,8 +2946,8 @@ echo "$ac_t""$libc_cv_uname_release" 1>&6
uname_release="$libc_cv_uname_release"
echo $ac_n "checking OS version for uname""... $ac_c" 1>&6
-echo "configure:2878: checking OS version for uname" >&5
-if eval "test \"`echo '$''{'libc_cv_uname_version'+set}'`\" = set"; then
+echo "configure:2950: checking OS version for uname" >&5
+if eval "test \"\${libc_cv_uname_version+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
kernel_version=`echo "$kernel_id" | sed 's/^[^#]*#\([0-9]*\).*$/\1/'`
@@ -2896,7 +2968,7 @@ else
fi
echo $ac_n "checking stdio selection""... $ac_c" 1>&6
-echo "configure:2900: checking stdio selection" >&5
+echo "configure:2972: checking stdio selection" >&5
case $stdio in
libio) cat >> confdefs.h <<\EOF
@@ -2910,7 +2982,7 @@ echo "$ac_t""$stdio" 1>&6
# Test for old glibc 2.0.x headers so that they can be removed properly
# Search only in includedir.
echo $ac_n "checking for old glibc 2.0.x headers""... $ac_c" 1>&6
-echo "configure:2914: checking for old glibc 2.0.x headers" >&5
+echo "configure:2986: checking for old glibc 2.0.x headers" >&5
if eval test -f "${includedir}/elfclass.h" -a -f "${includedir}/fcntlbits.h"
then
old_glibc_headers=yes
@@ -2964,8 +3036,8 @@ if test $shared = default; then
fi
echo $ac_n "checking whether -fPIC is default""... $ac_c" 1>&6
-echo "configure:2968: checking whether -fPIC is default" >&5
-if eval "test \"`echo '$''{'pic_default'+set}'`\" = set"; then
+echo "configure:3040: checking whether -fPIC is default" >&5
+if eval "test \"\${pic_default+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
pic_default=yes
@@ -3098,7 +3170,7 @@ do
echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
-version | --version | --versio | --versi | --vers | --ver | --ve | --v)
- echo "$CONFIG_STATUS generated by autoconf version 2.13"
+ echo "$CONFIG_STATUS generated by autoconf version 2.14.1"
exit 0 ;;
-help | --help | --hel | --he | --h)
echo "\$ac_cs_usage"; exit 0 ;;
@@ -3475,7 +3547,7 @@ exit 0
EOF
chmod +x $CONFIG_STATUS
rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+test "$no_create" = yes || $SHELL $CONFIG_STATUS || exit 1
if test "$no_recursion" != yes; then
@@ -3539,7 +3611,7 @@ if test "$no_recursion" != yes; then
# Check for guested configure; otherwise get Cygnus style configure.
if test -f $ac_sub_srcdir/configure; then
- ac_sub_configure=$ac_sub_srcdir/configure
+ ac_sub_configure="$SHELL $ac_sub_srcdir/configure"
elif test -f $ac_sub_srcdir/configure.in; then
ac_sub_configure=$ac_configure
else
@@ -3561,9 +3633,9 @@ if test "$no_recursion" != yes; then
*) INSTALL="$ac_dots$ac_given_INSTALL" ;;
esac
- echo "running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
+ echo "running $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir"
# The eval makes quoting arguments work.
- if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
+ if eval $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir
then :
else
{ echo "configure: error: $ac_sub_configure failed for $ac_config_dir" 1>&2; exit 1; }
diff --git a/configure.in b/configure.in
index ffc68f1f83..179b1adfa6 100644
--- a/configure.in
+++ b/configure.in
@@ -133,6 +133,13 @@ AC_ARG_ENABLE(force-install,
force_install=$enableval, force_install=yes)
AC_SUBST(force_install)
+dnl On some platforms we allow dropping compatibility with all kernel
+dnl versions.
+AC_ARG_ENABLE(kernel,
+[ --enable-kernel=VERSION compile for copmatibility with kernel not older
+ than VERSION],
+ minimum_kernel=$enableval)
+
AC_CANONICAL_HOST
# The way shlib-versions is used to generate soversions.mk uses a
diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
index bf5e797d31..f5d994b1c7 100644
--- a/sysdeps/unix/sysv/linux/configure
+++ b/sysdeps/unix/sysv/linux/configure
@@ -13,7 +13,7 @@ if test -n "$sysheaders"; then
fi
echo $ac_n "checking installed Linux kernel header files""... $ac_c" 1>&6
echo "configure:16: checking installed Linux kernel header files" >&5
-if eval "test \"`echo '$''{'libc_cv_linux2010'+set}'`\" = set"; then
+if eval "test \"\${libc_cv_linux2010+set}\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
@@ -49,6 +49,35 @@ make sure that file was built correctly when installing the kernel header
files. To use kernel headers not from /usr/include/linux, use the
configure option --with-headers." 1>&2; exit 1; }
fi
+
+# If the user gave a minimal version number test whether the available
+# kernel headers are young enough.
+if test -n "$minimum_kernel"; then
+ echo $ac_n "checking for kernel header at least $minimum_kernel""... $ac_c" 1>&6
+echo "configure:58: checking for kernel header at least $minimum_kernel" >&5
+ decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\(\([0-9]*\)\|\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+ cat > conftest.$ac_ext <<EOF
+#include <linux/version.h>
+int main() {
+#if LINUX_VERSION_CODE < $decnum
+eat flaming death
+#endif
+; return 0; }
+EOF
+ if { (eval echo configure:30: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ cat >> confdefs.h <<EOF
+#define __LINUX_KERNEL_VERSION $decnum
+EOF
+
+ echo "$ac_t""ok" 1>&6
+ else
+ echo "$ac_t""too old!" 1>&6
+ { echo "configure: error: *** The available kernel headers are not at least as old as the requested
+*** compatible kernel version" 1>&2; exit 1; }
+ fi
+ rm -f conftest*
+fi
+
if test -n "$sysheaders"; then
CFLAGS=$OLD_CFLAGS
fi
@@ -135,7 +164,7 @@ if test $host = $build; then
ac_prefix=$ac_default_prefix
fi
echo $ac_n "checking for symlinks in ${ac_prefix}/include""... $ac_c" 1>&6
-echo "configure:131: checking for symlinks in ${ac_prefix}/include" >&5
+echo "configure:168: checking for symlinks in ${ac_prefix}/include" >&5
ac_message=
if test -L ${ac_prefix}/include/net; then
ac_message="$ac_message
diff --git a/sysdeps/unix/sysv/linux/configure.in b/sysdeps/unix/sysv/linux/configure.in
index 2c425c5f25..021b4731eb 100644
--- a/sysdeps/unix/sysv/linux/configure.in
+++ b/sysdeps/unix/sysv/linux/configure.in
@@ -34,6 +34,33 @@ make sure that file was built correctly when installing the kernel header
files. To use kernel headers not from /usr/include/linux, use the
configure option --with-headers.])
fi
+
+# If the user gave a minimal version number test whether the available
+# kernel headers are young enough.
+if test -n "$minimum_kernel"; then
+ AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
+changequote(,)dnl
+ decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\(\([0-9]*\)\|\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+changequote([,])dnl
+ cat > conftest.$ac_ext <<EOF
+#include <linux/version.h>
+int main() {
+#if LINUX_VERSION_CODE < $decnum
+eat flaming death
+#endif
+; return 0; }
+EOF
+ if { (eval echo configure:30: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ AC_DEFINE_UNQUOTED(__LINUX_KERNEL_VERSION, $decnum)
+ AC_MSG_RESULT(ok)
+ else
+ AC_MSG_RESULT(too old!)
+ AC_MSG_ERROR([*** The available kernel headers are not at least as old as the requested
+*** compatible kernel version])
+ fi
+ rm -f conftest*
+fi
+
if test -n "$sysheaders"; then
CFLAGS=$OLD_CFLAGS
fi
diff --git a/sysdeps/unix/sysv/linux/getcwd.c b/sysdeps/unix/sysv/linux/getcwd.c
index fe28e2d894..cc7b987f9b 100644
--- a/sysdeps/unix/sysv/linux/getcwd.c
+++ b/sysdeps/unix/sysv/linux/getcwd.c
@@ -18,6 +18,7 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <assert.h>
#include <errno.h>
#include <limits.h>
#include <stdlib.h>
@@ -26,7 +27,19 @@
#include <sysdep.h>
#include <sys/syscall.h>
+#include "kernel-features.h"
+
+#if __ASSUME_GETCWD_SYSCALL > 0
+/* Kernel 2.1.92 introduced a third way to get the current working
+ directory: a syscall. We've got to be careful that even when
+ compiling under 2.1.92+ the libc still runs under older kernels. */
+extern int __syscall_getcwd (char *buf, unsigned long size);
+# define no_syscall_getcwd 0
+# define have_new_dcache 1
+/* This is a trick since we don't define generic_getcwd. */
+# define generic_getcwd getcwd
+#else
/* The "proc" filesystem provides an easy method to retrieve the value.
For each process, the corresponding directory contains a symbolic link
named `cwd'. Reading the content of this link immediate gives us the
@@ -34,16 +47,17 @@
the proc filesystem mounted. Use the POSIX implementation in this case. */
static char *generic_getcwd (char *buf, size_t size) internal_function;
-#ifdef __NR_getcwd
+# if __NR_getcwd
/* Kernel 2.1.92 introduced a third way to get the current working
directory: a syscall. We've got to be careful that even when
compiling under 2.1.92+ the libc still runs under older kernels. */
extern int __syscall_getcwd (char *buf, unsigned long size);
static int no_syscall_getcwd;
static int have_new_dcache;
-#else
-# define no_syscall_getcwd 1
+# else
+# define no_syscall_getcwd 1
static int have_new_dcache = 1;
+# endif
#endif
char *
@@ -80,7 +94,7 @@ __getcwd (char *buf, size_t size)
save_errno = errno;
-#ifdef __NR_getcwd
+#if defined __NR_getcwd || __LINUX_GETCWD_SYSCALL > 0
if (!no_syscall_getcwd)
{
int retval;
@@ -98,6 +112,16 @@ __getcwd (char *buf, size_t size)
return buf;
}
+# if __ASSUME_GETCWD_SYSCALL
+ /* It should never happen that the `getcwd' syscall failed because
+ the buffer is too small if we allocated the buffer outself. */
+ assert (errno != ERANGE || buf != NULL);
+
+ if (buf == NULL)
+ free (path);
+
+ return NULL;
+# else
if (errno == ENOSYS)
{
no_syscall_getcwd = 1;
@@ -111,6 +135,7 @@ __getcwd (char *buf, size_t size)
}
__set_errno (save_errno);
+# endif
}
#endif
@@ -136,14 +161,18 @@ __getcwd (char *buf, size_t size)
}
return buf;
}
+#ifndef have_new_dcache
else
have_new_dcache = 0;
+#endif
}
+#if __ASSUME_GETCWD_SYSCALL == 0
/* Set to have_new_dcache only if error indicates that proc doesn't
exist. */
if (errno != EACCES && errno != ENAMETOOLONG)
have_new_dcache = 0;
+#endif
/* Something went wrong. Restore the error number and use the generic
version. */
@@ -165,7 +194,9 @@ __getcwd (char *buf, size_t size)
}
weak_alias (__getcwd, getcwd)
+#if __ASSUME_GETCWD_SYSCALL == 0
/* Get the code for the generic version. */
-#define GETCWD_RETURN_TYPE static char * internal_function
-#define __getcwd generic_getcwd
-#include <sysdeps/posix/getcwd.c>
+# define GETCWD_RETURN_TYPE static char * internal_function
+# define __getcwd generic_getcwd
+# include <sysdeps/posix/getcwd.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/i386/chown.c b/sysdeps/unix/sysv/linux/i386/chown.c
index 3776a4490c..9ab03e3a7c 100644
--- a/sysdeps/unix/sysv/linux/i386/chown.c
+++ b/sysdeps/unix/sysv/linux/i386/chown.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999 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
@@ -22,6 +22,8 @@
#include <sysdep.h>
#include <sys/syscall.h>
+#include <kernel-features.h>
+
/*
In Linux 2.1.x the chown functions have been changed. A new function lchown
was introduced. The new chown now follows symlinks - the old chown and the
@@ -34,14 +36,15 @@
extern int __syscall_chown (const char *__file,
uid_t __owner, gid_t __group);
-#ifdef __NR_lchown
+#if defined __NR_lchown || __ASSUME_LCHOWN_SYSCALL > 0
/* Running under Linux > 2.1.80. */
-static int __libc_old_chown;
int
__real_chown (const char *file, uid_t owner, gid_t group)
{
+# if __ASSUME_LCHOWN_SYSCALL == 0
+ static int __libc_old_chown;
int result;
if (!__libc_old_chown)
@@ -57,11 +60,14 @@ __real_chown (const char *file, uid_t owner, gid_t group)
}
return __lchown (file, owner, group);
+# else
+ return INLINE_SYSCALL (chown, 3, file, owner, group);
+# endif
}
#endif
-#ifndef __NR_lchown
+#if !defined __NR_lchown && __ASSUME_LCHOWN_SYSCALL == 0
/* Compiling under older kernels. */
int
__chown_is_lchown (const char *file, uid_t owner, gid_t group)
diff --git a/sysdeps/unix/sysv/linux/i386/pread.c b/sysdeps/unix/sysv/linux/i386/pread.c
index 4c2f18d3f2..5745648306 100644
--- a/sysdeps/unix/sysv/linux/i386/pread.c
+++ b/sysdeps/unix/sysv/linux/i386/pread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,10 +23,14 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#ifdef __NR_pread
+#include <kernel-features.h>
+#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
+
+# if __ASSUME_PREAD_SYSCALL == 0
static ssize_t __emulate_pread (int fd, void *buf, size_t count,
off_t offset) internal_function;
+# endif
ssize_t
@@ -40,16 +44,21 @@ __pread (fd, buf, count, offset)
/* First try the syscall. */
result = INLINE_SYSCALL (pread, 5, fd, buf, count, offset, 0);
+# if __ASSUME_PREAD_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */
result = __emulate_pread (fd, buf, count, offset);
+# endif
return result;
}
weak_alias (__pread, pread)
-#define __pread(fd, buf, count, offset) \
+# define __pread(fd, buf, count, offset) \
static internal_function __emulate_pread (fd, buf, count, offset)
#endif
-#include <sysdeps/posix/pread.c>
+
+#if __ASSUME_PREAD_SYSCALL == 0
+# include <sysdeps/posix/pread.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/i386/pread64.c b/sysdeps/unix/sysv/linux/i386/pread64.c
index 8cfb3c0a43..aa0c54d385 100644
--- a/sysdeps/unix/sysv/linux/i386/pread64.c
+++ b/sysdeps/unix/sysv/linux/i386/pread64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,13 +23,14 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#ifdef __NR_pread
+#include <kernel-features.h>
-extern ssize_t __syscall_pread64 (int fd, void *buf, size_t count,
- off_t offset_hi, off_t offset_lo);
+#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
+# if __ASSUME_PREAD_SYSCALL == 0
static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
off64_t offset) internal_function;
+# endif
ssize_t
@@ -45,16 +46,21 @@ __pread64 (fd, buf, count, offset)
result = INLINE_SYSCALL (pread, 5, fd, buf, count,
(off_t) (offset & 0xffffffff),
(off_t) (offset >> 32));
+# if __ASSUME_PREAD_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */
result = __emulate_pread64 (fd, buf, count, offset);
+# endif
return result;
}
weak_alias (__pread64, pread64)
-#define __pread64(fd, buf, count, offset) \
+# define __pread64(fd, buf, count, offset) \
static internal_function __emulate_pread64 (fd, buf, count, offset)
#endif
-#include <sysdeps/posix/pread64.c>
+
+#if __ASSUME_PREAD_SYSCALL == 0
+# include <sysdeps/posix/pread64.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/i386/pwrite.c b/sysdeps/unix/sysv/linux/i386/pwrite.c
index a1fc99f156..90eee5b4e1 100644
--- a/sysdeps/unix/sysv/linux/i386/pwrite.c
+++ b/sysdeps/unix/sysv/linux/i386/pwrite.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,10 +23,14 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#ifdef __NR_pwrite
+#include <kernel-features.h>
+#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
+
+# if __ASSUME_PWRITE_SYSCALL == 0
static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count,
off_t offset) internal_function;
+# endif
ssize_t
@@ -40,16 +44,21 @@ __pwrite (fd, buf, count, offset)
/* First try the syscall. */
result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, offset, 0);
+# if __ASSUME_PWRITE_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */
result = __emulate_pwrite (fd, buf, count, offset);
+# endif
return result;
}
weak_alias (__pwrite, pwrite)
-#define __pwrite(fd, buf, count, offset) \
+# define __pwrite(fd, buf, count, offset) \
static internal_function __emulate_pwrite (fd, buf, count, offset)
#endif
-#include <sysdeps/posix/pwrite.c>
+
+#if __ASSUME_PWRITE_SYSCALL == 0
+# include <sysdeps/posix/pwrite.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/i386/pwrite64.c b/sysdeps/unix/sysv/linux/i386/pwrite64.c
index 7a5d665de3..500cd7cef3 100644
--- a/sysdeps/unix/sysv/linux/i386/pwrite64.c
+++ b/sysdeps/unix/sysv/linux/i386/pwrite64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,10 +23,14 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#ifdef __NR_pwrite
+#include <kernel-features.h>
+#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
+
+# if __ASSUME_PWRITE_SYSCALL == 0
static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
off64_t offset) internal_function;
+# endif
ssize_t
@@ -42,16 +46,21 @@ __pwrite64 (fd, buf, count, offset)
result = INLINE_SYSCALL (pwrite, 5, fd, buf, count,
(off_t) (offset & 0xffffffff),
(off_t) (offset >> 32));
+# if __ASSUME_PWRITE_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */
result = __emulate_pwrite64 (fd, buf, count, offset);
+# endif
return result;
}
weak_alias (__pwrite64, pwrite64)
-#define __pwrite64(fd, buf, count, offset) \
+# define __pwrite64(fd, buf, count, offset) \
static internal_function __emulate_pwrite64 (fd, buf, count, offset)
#endif
-#include <sysdeps/posix/pwrite64.c>
+
+#if __ASSUME_PWRITE_SYSCALL == 0
+# include <sysdeps/posix/pwrite64.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/init-first.c b/sysdeps/unix/sysv/linux/init-first.c
index 01395baf75..b8ee2bdf14 100644
--- a/sysdeps/unix/sysv/linux/init-first.c
+++ b/sysdeps/unix/sysv/linux/init-first.c
@@ -1,5 +1,5 @@
/* Initialization code run first thing by the ELF startup code. Linux version.
- Copyright (C) 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997, 1998, 1999 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
@@ -17,12 +17,17 @@
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
+#include <stdio.h>
+#include <fcntl.h>
#include <unistd.h>
#include <sysdep.h>
#include <fpu_control.h>
#include <linux/personality.h>
#include <init-first.h>
+#include <sys/param.h>
+#include <sys/sysctl.h>
#include <sys/types.h>
+#include "kernel-features.h"
extern void __libc_init_secure (void);
extern void __libc_init (int, char **, char **);
@@ -31,6 +36,10 @@ extern void __libc_global_ctors (void);
/* The function is called from assembly stubs the compiler can't see. */
static void init (int, char **, char **) __attribute__ ((unused));
+/* The function we use to get the kernel revision. */
+extern int __sysctl (int *name, int nlen, void *oldval, size_t *oldlenp,
+ void *newval, size_t newlen);
+
extern int _dl_starting_up;
weak_extern (_dl_starting_up)
@@ -56,6 +65,69 @@ init (int argc, char **argv, char **envp)
/* We must not call `personality' twice. */
if (!__libc_multiple_libcs)
{
+ /* Test whether the kernel is new enough. This test is only
+ performed if the library is not compiled to run on all
+ kernels. */
+ if (__LINUX_KERNEL_VERSION > 0)
+ {
+ static const int sysctl_args[] = { CTL_KERN, KERN_OSRELEASE };
+ char buf[64];
+ size_t reslen = sizeof (buf);
+ unsigned int version;
+ int parts;
+ char *cp;
+
+ /* Try reading the number using `sysctl' first. */
+ if (__sysctl ((int *) sysctl_args,
+ sizeof (sysctl_args) / sizeof (sysctl_args[0]),
+ buf, &reslen, NULL, 0) < 0)
+ {
+ /* This was not successful. Now try reading the /proc
+ filesystem. */
+ int fd = __open ("/proc/sys/kernel/osrelease", O_RDONLY);
+ if (fd == -1
+ || (reslen = __read (fd, buf, sizeof (buf))) <= 0)
+ /* This also didn't work. We give up since we cannot
+ make sure the library can actually work. */
+ __libc_fatal ("FATAL: cannot determine library version\n");
+
+ __close (fd);
+ }
+ buf[MIN (reslen, sizeof (buf) - 1)] = '\0';
+
+ /* Now convert it into a number. The string consists of at most
+ three parts. */
+ version = 0;
+ parts = 0;
+ cp = buf;
+ while ((*cp >= '0') && (*cp <= '9'))
+ {
+ unsigned int here = *cp++ - '0';
+
+ while ((*cp >= '0') && (*cp <= '9'))
+ {
+ here *= 10;
+ here += *cp++ - '0';
+ }
+
+ ++parts;
+ version <<= 8;
+ version |= here;
+
+ if (*cp++ != '.')
+ /* Another part following? */
+ break;
+ }
+
+ if (parts < 3)
+ version <<= 8 * (3 - parts);
+
+ /* Now we can test with the required version. */
+ if (version < __LINUX_KERNEL_VERSION)
+ /* Not sufficent. */
+ __libc_fatal ("FATAL: kernel too old\n");
+ }
+
/* The `personality' system call takes one argument that chooses
the "personality", i.e. the set of system calls and such. We
must make this call first thing to disable emulation of some
diff --git a/sysdeps/unix/sysv/linux/kernel-features.h b/sysdeps/unix/sysv/linux/kernel-features.h
new file mode 100644
index 0000000000..6813853ccc
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/kernel-features.h
@@ -0,0 +1,74 @@
+/* Set flags signalling availability of kernel features based on given
+ kernel version number.
+ Copyright (C) 1999 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
+ modify it under the terms of the GNU Library General Public License as
+ published by the Free Software Foundation; either version 2 of the
+ License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This file must not contain any C code. At least it must be protected
+ to allow using the file also in assembler files. */
+
+/* XXX For testing. */
+#define __LINUX_KERNEL_VERSION 131584
+
+#ifndef __LINUX_KERNEL_VERSION
+/* We assume the worst; all kernels should be supported. */
+# define __LINUX_KERNEL_VERSION 0
+#endif
+
+/* We assume for __LINUX_KERNEL_VERSION the same encoding used in
+ linux/version.h. I.e., the major, minor, and subminor all get a
+ byte with the major number being in the highest byte. This means
+ we can do numeric comparisons.
+
+ In the following we will define certain symbols depending on
+ whether the describes kernel feature is available in the kernel
+ version given by __LINUX_KERNEL_VERSION. We are not always exactly
+ recording the correct versions in which the features were
+ introduced. If somebody cares these values can afterwards be
+ corrected. Most of the numbers here are set corresponding to
+ 2.2.0. */
+
+/* `getcwd' system call. */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_GETCWD_SYSCALL 1
+#endif
+
+/* Real-time signal became usable in 2.1.70. */
+#if __LINUX_KERNEL_VERSION >= 131398
+# define __ASSUME_REALTIME_SIGNALS 1
+#endif
+
+/* When were the `pread'/`pwrite' syscalls introduced? */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_PREAD_SYSCALL 1
+# define __ASSUME_PWRITE_SYSCALL 1
+#endif
+
+/* When was `poll' introduced? */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_POLL_SYSCALL 1
+#endif
+
+/* The `lchown' syscall was introduced in 2.1.80. */
+#if __LINUX_KERNEL_VERSION >= 131408
+# define __ASSUME_LCHOWN_SYSCALL 1
+#endif
+
+/* When did the `setresuid' sysall became available? */
+#if __LINUX_KERNEL_VERSION >= 131584
+# define __ASSUME_SETRESUID_SYSCALL 1
+#endif
diff --git a/sysdeps/unix/sysv/linux/poll.c b/sysdeps/unix/sysv/linux/poll.c
index e7df3b7774..16433e53e7 100644
--- a/sysdeps/unix/sysv/linux/poll.c
+++ b/sysdeps/unix/sysv/linux/poll.c
@@ -22,13 +22,18 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#ifdef __NR_poll
+
+#include "kernel-features.h"
+
+#if defined __NR_poll || __ASSUME_POLL_SYSCALL > 0
extern int __syscall_poll __P ((struct pollfd *fds, unsigned int nfds,
int timeout));
+# if __ASSUME_POLL_SYSCALL == 0
static int __emulate_poll __P ((struct pollfd *fds, unsigned long int nfds,
int timeout)) internal_function;
+# endif
/* The real implementation. */
int
@@ -37,6 +42,7 @@ __poll (fds, nfds, timeout)
unsigned long int nfds;
int timeout;
{
+# if __ASSUME_POLL_SYSCALL == 0
static int must_emulate;
if (!must_emulate)
@@ -52,6 +58,9 @@ __poll (fds, nfds, timeout)
}
return __emulate_poll (fds, nfds, timeout);
+# else
+ return INLINE_SYSCALL (poll, 3, fds, nfds, timeout);
+# endif
}
weak_alias (__poll, poll)
@@ -59,4 +68,7 @@ weak_alias (__poll, poll)
# define __poll(fds, nfds, timeout) \
static internal_function __emulate_poll (fds, nfds, timeout)
#endif
-#include <sysdeps/unix/bsd/poll.c>
+
+#if __ASSUME_POLL_SYSCALL == 0
+# include <sysdeps/unix/bsd/poll.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/pread.c b/sysdeps/unix/sysv/linux/pread.c
index a9461cab2e..cae3d62a5d 100644
--- a/sysdeps/unix/sysv/linux/pread.c
+++ b/sysdeps/unix/sysv/linux/pread.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,13 +23,17 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#ifdef __NR_pread
+#include "kernel-features.h"
+
+#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
extern ssize_t __syscall_pread (int fd, void *buf, size_t count,
off_t offset_hi, off_t offset_lo);
+# if __ASSUME_PREAD_SYSCALL == 0
static ssize_t __emulate_pread (int fd, void *buf, size_t count,
off_t offset) internal_function;
+# endif
ssize_t
@@ -43,16 +47,21 @@ __pread (fd, buf, count, offset)
/* First try the syscall. */
result = INLINE_SYSCALL (pread, 5, fd, buf, count, 0, offset);
+# if __ASSUME_PREAD_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */
result = __emulate_pread (fd, buf, count, offset);
+# endif
return result;
}
weak_alias (__pread, pread)
-#define __pread(fd, buf, count, offset) \
+# define __pread(fd, buf, count, offset) \
static internal_function __emulate_pread (fd, buf, count, offset)
#endif
-#include <sysdeps/posix/pread.c>
+
+#if __ASSUME_PREAD_SYSCALL == 0
+# include <sysdeps/posix/pread.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/pread64.c b/sysdeps/unix/sysv/linux/pread64.c
index b8e117770f..fc4f7f24a0 100644
--- a/sysdeps/unix/sysv/linux/pread64.c
+++ b/sysdeps/unix/sysv/linux/pread64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,13 +23,17 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#ifdef __NR_pread
+#include "kernel-features.h"
+
+#if defined __NR_pread || __ASSUME_PREAD_SYSCALL > 0
extern ssize_t __syscall_pread (int fd, void *buf, size_t count,
off_t offset_hi, off_t offset_lo);
+# if __ASSUME_PREAD_SYSCALL == 0
static ssize_t __emulate_pread64 (int fd, void *buf, size_t count,
off64_t offset) internal_function;
+# endif
ssize_t
@@ -44,16 +48,21 @@ __pread64 (fd, buf, count, offset)
/* First try the syscall. */
result = INLINE_SYSCALL (pread, 5, fd, buf, count, (off_t) (offset >> 32),
(off_t) (offset & 0xffffffff));
+# if __ASSUME_PREAD_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */
result = __emulate_pread64 (fd, buf, count, offset);
+# endif
return result;
}
weak_alias (__pread64, pread64)
-#define __pread64(fd, buf, count, offset) \
+# define __pread64(fd, buf, count, offset) \
static internal_function __emulate_pread64 (fd, buf, count, offset)
#endif
-#include <sysdeps/posix/pread64.c>
+
+# if __ASSUME_PREAD_SYSCALL == 0
+# include <sysdeps/posix/pread64.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/pwrite.c b/sysdeps/unix/sysv/linux/pwrite.c
index cd7b8adaa1..fd4ec8896d 100644
--- a/sysdeps/unix/sysv/linux/pwrite.c
+++ b/sysdeps/unix/sysv/linux/pwrite.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,13 +23,17 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#ifdef __NR_pwrite
+#include "kernel-features.h"
+
+#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
extern ssize_t __syscall_pwrite (int fd, const void *buf, size_t count,
off_t offset_hi, off_t offset_lo);
+# if __ASSUME_PWRITE_SYSCALL == 0
static ssize_t __emulate_pwrite (int fd, const void *buf, size_t count,
off_t offset) internal_function;
+# endif
ssize_t
@@ -43,16 +47,21 @@ __pwrite (fd, buf, count, offset)
/* First try the syscall. */
result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, 0, offset);
+# if __ASSUME_PWRITE_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */
result = __emulate_pwrite (fd, buf, count, offset);
+# endif
return result;
}
weak_alias (__pwrite, pwrite)
-#define __pwrite(fd, buf, count, offset) \
+# define __pwrite(fd, buf, count, offset) \
static internal_function __emulate_pwrite (fd, buf, count, offset)
#endif
-#include <sysdeps/posix/pwrite.c>
+
+#if __ASSUME_PWRITE_SYSCALL == 0
+# include <sysdeps/posix/pwrite.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/pwrite64.c b/sysdeps/unix/sysv/linux/pwrite64.c
index b6ebba154b..cc92de1d76 100644
--- a/sysdeps/unix/sysv/linux/pwrite64.c
+++ b/sysdeps/unix/sysv/linux/pwrite64.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -23,13 +23,17 @@
#include <sysdep.h>
#include <sys/syscall.h>
-#ifdef __NR_pwrite
+#include "kernel-features.h"
+
+#if defined __NR_pwrite || __ASSUME_PWRITE_SYSCALL > 0
extern ssize_t __syscall_pwrite64 (int fd, const void *buf, size_t count,
off_t offset_hi, off_t offset_lo);
+# if __ASSUME_PWRITE_SYSCALL == 0
static ssize_t __emulate_pwrite64 (int fd, const void *buf, size_t count,
off64_t offset) internal_function;
+# endif
ssize_t
@@ -44,16 +48,21 @@ __pwrite64 (fd, buf, count, offset)
/* First try the syscall. */
result = INLINE_SYSCALL (pwrite, 5, fd, buf, count, (off_t) (offset >> 32),
(off_t) (offset & 0xffffffff));
+# if __ASSUME_PWRITE_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use the emulation. */
result = __emulate_pwrite64 (fd, buf, count, offset);
+# endif
return result;
}
weak_alias (__pwrite64, pwrite64)
-#define __pwrite64(fd, buf, count, offset) \
+# define __pwrite64(fd, buf, count, offset) \
static internal_function __emulate_pwrite64 (fd, buf, count, offset)
#endif
-#include <sysdeps/posix/pwrite64.c>
+
+#if __ASSUME_PWRITE_SYSCALL == 0
+# include <sysdeps/posix/pwrite64.c>
+#endif
diff --git a/sysdeps/unix/sysv/linux/seteuid.c b/sysdeps/unix/sysv/linux/seteuid.c
index 20840dbfc0..15687e36e4 100644
--- a/sysdeps/unix/sysv/linux/seteuid.c
+++ b/sysdeps/unix/sysv/linux/seteuid.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1998, 1999 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
@@ -21,7 +21,9 @@
#include <sys/types.h>
#include <unistd.h>
-#ifdef __NR_setresuid
+#include "kernel-features.h"
+
+#if defined __NR_setresuid || __ASSUME_SETRESUID_SYSCALL > 0
extern int __setresuid (uid_t ruid, uid_t euid, uid_t suid);
@@ -38,11 +40,13 @@ seteuid (uid_t uid)
/* First try the syscall. */
result = __setresuid (-1, uid, -1);
+# if __ASSUME_SETRESUID_SYSCALL == 0
if (result == -1 && errno == ENOSYS)
/* No system call available. Use emulation. This may not work
since `setreuid' also sets the saved user ID when UID is not
equal to the real user ID, making it impossible to switch back. */
result = __setreuid (-1, uid);
+# endif
return result;
}
diff --git a/sysdeps/unix/sysv/linux/sigaction.c b/sysdeps/unix/sysv/linux/sigaction.c
index a5580cc0e6..40f9bbc252 100644
--- a/sysdeps/unix/sysv/linux/sigaction.c
+++ b/sysdeps/unix/sysv/linux/sigaction.c
@@ -23,20 +23,27 @@
#include <sysdep.h>
#include <sys/syscall.h>
+#include "kernel-features.h"
+
/* The difference here is that the sigaction structure used in the
kernel is not the same as we use in the libc. Therefore we must
translate it here. */
#include <kernel_sigaction.h>
+#if __ASSUME_REALTIME_SIGNALS == 0
+/* The variable is shared between all wrappers around signal handling
+ functions which have RT equivalents. This is the definition. */
+int __libc_missing_rt_sigs;
+
extern int __syscall_sigaction (int, const struct old_kernel_sigaction *,
struct old_kernel_sigaction *);
+# define rtsignals_guaranteed 0
+#else
+# define rtsignals_guaranteed 1
+#endif
extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *,
struct kernel_sigaction *, size_t);
-/* The variable is shared between all wrappers around signal handling
- functions which have RT equivalents. This is the definition. */
-int __libc_missing_rt_sigs;
-
/* If ACT is not NULL, change the action for SIG to *ACT.
If OACT is not NULL, put the old action for SIG in *OACT. */
@@ -49,12 +56,18 @@ __sigaction (sig, act, oact)
struct old_kernel_sigaction k_sigact, k_osigact;
int result;
-#ifdef __NR_rt_sigaction
+#if defiend __NR_rt_sigaction || __ASSUME_REALTIME_SIGNALS > 0
/* First try the RT signals. */
+# if __ASSUME_REALTIME_SIGNALS == 0
if (!__libc_missing_rt_sigs)
+# endif
{
struct kernel_sigaction kact, koact;
+ /* Save the current error value for later. We need not do this
+ if we are guaranteed to have realtime signals. */
+# if __ASSUME_REALTIME_SIGNALS == 0
int saved_errno = errno;
+# endif
if (act)
{
@@ -71,7 +84,9 @@ __sigaction (sig, act, oact)
result = INLINE_SYSCALL (rt_sigaction, 4, sig, act ? &kact : NULL,
oact ? &koact : NULL, _NSIG / 8);
+# if __ASSUME_REALTIME_SIGNALS == 0
if (result >= 0 || errno != ENOSYS)
+# endif
{
if (oact && result >= 0)
{
@@ -85,19 +100,22 @@ __sigaction (sig, act, oact)
return result;
}
+# if __ASSUME_REALTIME_SIGNALS == 0
__set_errno (saved_errno);
__libc_missing_rt_sigs = 1;
+# endif
}
#endif
+#if __ASSUME_REALTIME_SIGNALS == 0
if (act)
{
k_sigact.k_sa_handler = act->sa_handler;
k_sigact.sa_mask = act->sa_mask.__val[0];
k_sigact.sa_flags = act->sa_flags;
-#ifdef HAVE_SA_RESTORER
+# ifdef HAVE_SA_RESTORER
k_sigact.sa_restorer = act->sa_restorer;
-#endif
+# endif
}
result = INLINE_SYSCALL (sigaction, 3, sig, act ? &k_sigact : NULL,
oact ? &k_osigact : NULL);
@@ -106,11 +124,12 @@ __sigaction (sig, act, oact)
oact->sa_handler = k_osigact.k_sa_handler;
oact->sa_mask.__val[0] = k_osigact.sa_mask;
oact->sa_flags = k_osigact.sa_flags;
-#ifdef HAVE_SA_RESTORER
+# ifdef HAVE_SA_RESTORER
oact->sa_restorer = k_osigact.sa_restorer;
-#endif
+# endif
}
return result;
+#endif
}
weak_alias (__sigaction, sigaction)
diff --git a/sysdeps/unix/sysv/linux/sigpending.c b/sysdeps/unix/sysv/linux/sigpending.c
index c41c4f266a..932314520c 100644
--- a/sysdeps/unix/sysv/linux/sigpending.c
+++ b/sysdeps/unix/sysv/linux/sigpending.c
@@ -23,6 +23,8 @@
#include <sysdep.h>
#include <sys/syscall.h>
+#include "kernel-features.h"
+
extern int __syscall_sigpending (sigset_t *);
extern int __syscall_rt_sigpending (sigset_t *, size_t);
@@ -38,7 +40,10 @@ int
sigpending (set)
sigset_t *set;
{
-#ifdef __NR_rt_pending
+#if __ASSUME_REALTIME_SIGNALS > 0
+ return INLINE_SYSCALL (rt_sigpending, 2, set, _NSIG / 8);
+#else
+# ifdef __NR_rt_pending
/* First try the RT signals. */
if (!__libc_missing_rt_sigs)
{
@@ -53,7 +58,8 @@ sigpending (set)
__set_errno (saved_errno);
__libc_missing_rt_sigs = 1;
}
-#endif
+# endif
return INLINE_SYSCALL (sigpending, 1, set);
+#endif
}
diff --git a/sysdeps/unix/sysv/linux/sigprocmask.c b/sysdeps/unix/sysv/linux/sigprocmask.c
index 5e72c9892d..3e0719aa7f 100644
--- a/sysdeps/unix/sysv/linux/sigprocmask.c
+++ b/sysdeps/unix/sysv/linux/sigprocmask.c
@@ -23,6 +23,9 @@
#include <sysdep.h>
#include <sys/syscall.h>
+#include "kernel-features.h"
+
+
extern int __syscall_sigprocmask (int, const sigset_t *, sigset_t *);
extern int __syscall_rt_sigprocmask (int, const sigset_t *, sigset_t *,
size_t);
@@ -39,7 +42,10 @@ __sigprocmask (how, set, oset)
const sigset_t *set;
sigset_t *oset;
{
-#ifdef __NR_rt_sigprocmask
+#if __ASSUME_REALTIME_SIGNALS > 0
+ return INLINE_SYSCALL (rt_sigprocmask, 4, how, set, oset, _NSIG / 8);
+#else
+# ifdef __NR_rt_sigprocmask
/* First try the RT signals. */
if (!__libc_missing_rt_sigs)
{
@@ -55,8 +61,9 @@ __sigprocmask (how, set, oset)
__set_errno (saved_errno);
__libc_missing_rt_sigs = 1;
}
-#endif
+# endif
return INLINE_SYSCALL (sigprocmask, 3, how, set, oset);
+#endif
}
weak_alias (__sigprocmask, sigprocmask)
diff --git a/sysdeps/unix/sysv/linux/sigsuspend.c b/sysdeps/unix/sysv/linux/sigsuspend.c
index 1d0dba0270..da743396b8 100644
--- a/sysdeps/unix/sysv/linux/sigsuspend.c
+++ b/sysdeps/unix/sysv/linux/sigsuspend.c
@@ -23,6 +23,8 @@
#include <sysdep.h>
#include <sys/syscall.h>
+#include "kernel-features.h"
+
extern int __syscall_sigsuspend (int, unsigned long int, unsigned long int);
extern int __syscall_rt_sigsuspend (const sigset_t *, size_t);
@@ -38,7 +40,10 @@ int
__sigsuspend (set)
const sigset_t *set;
{
-#ifdef __NR_rt_sigsuspend
+#if __ASSUME_REALTIME_SIGNALS
+ return INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8);
+#else
+# ifdef __NR_rt_sigsuspend
/* First try the RT signals. */
if (!__libc_missing_rt_sigs)
{
@@ -53,8 +58,9 @@ __sigsuspend (set)
__set_errno (saved_errno);
__libc_missing_rt_sigs = 1;
}
-#endif
+# endif
return INLINE_SYSCALL (sigsuspend, 3, 0, 0, set->__val[0]);
+#endif
}
weak_alias (__sigsuspend, sigsuspend)
diff --git a/sysdeps/unix/sysv/linux/sysctl.c b/sysdeps/unix/sysv/linux/sysctl.c
index 1ab3c79bed..b131820a30 100644
--- a/sysdeps/unix/sysv/linux/sysctl.c
+++ b/sysdeps/unix/sysv/linux/sysctl.c
@@ -1,5 +1,5 @@
/* Read or write system information. Linux version.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999 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
@@ -26,8 +26,8 @@
extern int __syscall__sysctl (struct __sysctl_args *args);
int
-sysctl (int *name, int nlen, void *oldval, size_t *oldlenp,
- void *newval, size_t newlen)
+__sysctl (int *name, int nlen, void *oldval, size_t *oldlenp,
+ void *newval, size_t newlen)
{
struct __sysctl_args args =
{
@@ -41,3 +41,4 @@ sysctl (int *name, int nlen, void *oldval, size_t *oldlenp,
return INLINE_SYSCALL (_sysctl, 1, &args);
}
+weak_alias (__sysctl, sysctl)
diff --git a/sysdeps/unix/sysv/linux/testrtsig.h b/sysdeps/unix/sysv/linux/testrtsig.h
index 7c41877e66..72d4e5a3d2 100644
--- a/sysdeps/unix/sysv/linux/testrtsig.h
+++ b/sysdeps/unix/sysv/linux/testrtsig.h
@@ -1,5 +1,5 @@
/* Test whether RT signals are really available.
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1999 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
@@ -21,10 +21,16 @@
#include <string.h>
#include <sys/utsname.h>
+#include "kernel-features.h"
+
static int
kernel_has_rtsig (void)
{
+#if __ASSUME_REALTIME_SIGNALS
+ return 1;
+#else
struct utsname name;
return uname (&name) == 0 && __strverscmp (name.release, "2.1.70") >= 0;
+#endif
}