summaryrefslogtreecommitdiff
path: root/sysdeps/mach
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-11-01 01:47:02 +0100
committerThomas Schwinge <thomas@codesourcery.com>2012-11-01 01:47:02 +0100
commit54ba70f8e505eb8cd7e2fa7c1daf76bf0fcc7663 (patch)
tree5a09827c7a9a2ae4b66afe7fed08b963e8dd03a3 /sysdeps/mach
parentf1501f42ac1e796434a05e327d513c995ba0f3d0 (diff)
parent343dc156c34702751b3cc63736caa0649c59421a (diff)
Merge commit 'refs/top-bases/t/bigmem' into t/bigmem
Diffstat (limited to 'sysdeps/mach')
-rw-r--r--sysdeps/mach/bits/libc-lock.h1
-rw-r--r--sysdeps/mach/configure138
-rw-r--r--sysdeps/mach/hurd/Makeconfig3
-rw-r--r--sysdeps/mach/hurd/_G_config.h92
-rw-r--r--sysdeps/mach/hurd/bits/libc-lock.h2
-rw-r--r--sysdeps/mach/hurd/bits/local_lim.h13
-rw-r--r--sysdeps/mach/hurd/bits/param.h (renamed from sysdeps/mach/hurd/sys/param.h)60
-rw-r--r--sysdeps/mach/hurd/bits/typesizes.h1
-rw-r--r--sysdeps/mach/hurd/configure123
-rw-r--r--sysdeps/mach/hurd/configure.in3
-rw-r--r--sysdeps/mach/hurd/dl-sysdep.c20
-rw-r--r--sysdeps/mach/hurd/eloop-threshold.h37
-rw-r--r--sysdeps/mach/hurd/fdatasync.c8
-rw-r--r--sysdeps/mach/hurd/fsync.c8
-rw-r--r--sysdeps/mach/hurd/malloc-machine.h5
-rw-r--r--sysdeps/mach/hurd/ptrace.c8
-rw-r--r--sysdeps/mach/hurd/renameat.c51
-rw-r--r--sysdeps/mach/hurd/sysconf.c (renamed from sysdeps/mach/hurd/dl-cache.c)20
18 files changed, 129 insertions, 464 deletions
diff --git a/sysdeps/mach/bits/libc-lock.h b/sysdeps/mach/bits/libc-lock.h
index 110e25e965..94877e0ea7 100644
--- a/sysdeps/mach/bits/libc-lock.h
+++ b/sysdeps/mach/bits/libc-lock.h
@@ -137,7 +137,6 @@ void *__libc_getspecific (__libc_key_t key);
#define __libc_lock_lock_recursive __libc_lock_lock
#define __rtld_lock_define_initialized_recursive __libc_lock_define_initialized
-#define __rtld_lock_init_recursive __libc_lock_init
#define __rtld_lock_fini_recursive __libc_lock_fini
#define __rtld_lock_trylock_recursive __libc_lock_trylock
#define __rtld_lock_unlock_recursive __libc_lock_unlock
diff --git a/sysdeps/mach/configure b/sysdeps/mach/configure
index b41449e803..33cf09bd71 100644
--- a/sysdeps/mach/configure
+++ b/sysdeps/mach/configure
@@ -1,102 +1,4 @@
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-# as_fn_arith ARG...
-# ------------------
-# Perform arithmetic evaluation on the ARGs, and store the result in the
-# global $as_val. Take advantage of shells that can avoid forks. The arguments
-# must be portable across $(()) and expr.
-if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
- eval 'as_fn_arith ()
- {
- as_val=$(( $* ))
- }'
-else
- as_fn_arith ()
- {
- as_val=`expr "$@" || test $? -eq 1`
- }
-fi # as_fn_arith
-
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
# ac_fn_c_try_cpp LINENO
# ----------------------
@@ -288,45 +190,7 @@ $as_echo_n "checking for task_t in mach/mach_types.h... " >&6; }
if ${libc_cv_mach_task_t+:} false; then :
$as_echo_n "(cached) " >&6
else
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <mach/mach_types.h>
int
diff --git a/sysdeps/mach/hurd/Makeconfig b/sysdeps/mach/hurd/Makeconfig
index 1b65bb07aa..fe3b7c553e 100644
--- a/sysdeps/mach/hurd/Makeconfig
+++ b/sysdeps/mach/hurd/Makeconfig
@@ -2,3 +2,6 @@
# See Makefile in this directory for the rule that builds this.
# We must define this variable earlier than sysdeps Makefiles are included.
static-start-installed-name = crt0.o
+
+# GNU libc on the Hurd is always reentrant.
+libc-reentrant = yes
diff --git a/sysdeps/mach/hurd/_G_config.h b/sysdeps/mach/hurd/_G_config.h
deleted file mode 100644
index 9ecd4aad39..0000000000
--- a/sysdeps/mach/hurd/_G_config.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/* This file is needed by libio to define various configuration parameters.
- These are always the same in the GNU C library. */
-
-#ifndef _G_config_h
-#define _G_config_h 1
-
-/* Define types for libio in terms of the standard internal type names. */
-
-#include <bits/types.h>
-#define __need_size_t
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
-# define __need_wchar_t
-#endif
-#define __need_NULL
-#include <stddef.h>
-#define __need_mbstate_t
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
-# define __need_wint_t
-#endif
-#include <wchar.h>
-#define _G_size_t size_t
-typedef struct
-{
- __off_t __pos;
- __mbstate_t __state;
-} _G_fpos_t;
-typedef struct
-{
- __off64_t __pos;
- __mbstate_t __state;
-} _G_fpos64_t;
-#define _G_ssize_t __ssize_t
-#define _G_off_t __off_t
-#define _G_off64_t __off64_t
-#define _G_pid_t __pid_t
-#define _G_uid_t __uid_t
-#define _G_wchar_t wchar_t
-#define _G_wint_t wint_t
-#define _G_stat64 stat64
-#if defined _LIBC || defined _GLIBCPP_USE_WCHAR_T
-# include <gconv.h>
-typedef union
-{
- struct __gconv_info __cd;
- struct
- {
- struct __gconv_info __cd;
- struct __gconv_step_data __data;
- } __combined;
-} _G_iconv_t;
-#endif
-
-typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
-typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
-typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
-typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
-
-#define _G_HAVE_BOOL 1
-
-
-/* These library features are always available in the GNU C library. */
-#define _G_HAVE_ATEXIT 1
-#define _G_HAVE_SYS_WAIT 1
-#define _G_NEED_STDARG_H 1
-#define _G_va_list __gnuc_va_list
-
-#define _G_HAVE_PRINTF_FP 1
-#define _G_HAVE_MMAP 1
-#define _G_HAVE_LONG_DOUBLE_IO 1
-#define _G_HAVE_IO_FILE_OPEN 1
-#define _G_HAVE_IO_GETLINE_INFO 1
-
-#define _G_IO_IO_FILE_VERSION 0x20001
-
-#define _G_OPEN64 __open64
-#define _G_LSEEK64 __lseek64
-#define _G_MMAP64 __mmap64
-#define _G_FSTAT64(fd,buf) __fxstat64 (_STAT_VER, fd, buf)
-
-/* This is defined by <bits/stat.h> if `st_blksize' exists. */
-#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)
-
-#define _G_BUFSIZ 8192
-
-/* These are the vtbl details for ELF. */
-#define _G_NAMES_HAVE_UNDERSCORE 0
-#define _G_VTABLE_LABEL_HAS_LENGTH 1
-#define _G_USING_THUNKS 1
-#define _G_VTABLE_LABEL_PREFIX "__vt_"
-#define _G_VTABLE_LABEL_PREFIX_ID __vt_
-
-#endif /* _G_config.h */
diff --git a/sysdeps/mach/hurd/bits/libc-lock.h b/sysdeps/mach/hurd/bits/libc-lock.h
index d18a10c457..e8cb71bfdd 100644
--- a/sysdeps/mach/hurd/bits/libc-lock.h
+++ b/sysdeps/mach/hurd/bits/libc-lock.h
@@ -119,8 +119,6 @@ typedef struct __libc_lock_recursive_opaque__ __libc_lock_recursive_t;
})
-#define __rtld_lock_init_recursive(NAME) \
- __libc_lock_init_recursive (NAME)
#define __rtld_lock_initialize(NAME) \
(void) ((NAME) = (__rtld_lock_recursive_t) _RTLD_LOCK_RECURSIVE_INITIALIZER)
#define __rtld_lock_trylock_recursive(NAME) \
diff --git a/sysdeps/mach/hurd/bits/local_lim.h b/sysdeps/mach/hurd/bits/local_lim.h
index 48411d071c..c957dad767 100644
--- a/sysdeps/mach/hurd/bits/local_lim.h
+++ b/sysdeps/mach/hurd/bits/local_lim.h
@@ -1,5 +1,5 @@
/* Minimum guaranteed maximum values for system limits. Hurd version.
- Copyright (C) 1993,94,96,98,2002 Free Software Foundation, Inc.
+ Copyright (C) 1993-2012 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
@@ -32,14 +32,3 @@
suitable, and `sysconf' will return a number at least as large. */
#define NGROUPS_MAX 256
-
-/* The maximum number of symbolic links that are allowed in a single file
- name resolution. When a further link is encountered, the call returns
- ELOOP. This name is a GNU extension; POSIX.1 has no such limit, and BSD
- calls it MAXSYMLINKS in <sys/param.h>. (We define the name under
- _BSD_SOURCE even without _GNU_SOURCE because our <sys/param.h> uses it
- to define MAXSYMLINKS.) */
-
-#if defined __USE_GNU || defined __USE_BSD /* 1003.1a defines this */
-#define SYMLOOP_MAX 8
-#endif
diff --git a/sysdeps/mach/hurd/sys/param.h b/sysdeps/mach/hurd/bits/param.h
index 42f4f46e7d..d52c1edcb6 100644
--- a/sysdeps/mach/hurd/sys/param.h
+++ b/sysdeps/mach/hurd/bits/param.h
@@ -1,4 +1,5 @@
-/* Copyright (C) 1993,1994,1995,1997,1999,2011 Free Software Foundation, Inc.
+/* Old-style Unix parameters and limits. Hurd version.
+ Copyright (C) 1993-2012 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
@@ -15,6 +16,10 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
+#ifndef _SYS_PARAM_H
+# error "Never use <bits/param.h> directly; include <sys/param.h> instead."
+#endif
+
/* This file is deprecated and is provided only for compatibility with
Unix systems. It is unwise to include this file on programs which
are intended only for GNU systems.
@@ -52,24 +57,6 @@
*/
-#ifndef _SYS_PARAM_H
-
-#define _SYS_PARAM_H 1
-#include <features.h>
-
-#define __need_NULL
-#include <stddef.h>
-
-#include <sys/types.h>
-#include <errno.h>
-#include <signal.h>
-#include <endian.h>
-#include <limits.h>
-#ifdef notyet
-# include <ufs/param.h>
-#endif
-
-
/* What versions of BSD we are compatible with. */
#define BSD 199306 /* System version (year & month). */
#define BSD4_3 1
@@ -81,47 +68,12 @@
/* BSD names for some <limits.h> values. We do not define the BSD names
for the values which are not statically limited, such as NOFILE. */
-#define NBBY CHAR_BIT
-#define NGROUPS NGROUPS_MAX
-#define MAXSYMLINKS SYMLOOP_MAX
-#define CANBSIZ MAX_CANON /* XXX ? */
-
-/* ARG_MAX is unlimited, but we define NCARGS for BSD programs that want to
- compare against some fixed limit. */
-#define NCARGS INT_MAX
/* There is nothing quite equivalent in GNU to Unix "mounts", but there is
no limit on the number of simultaneously attached filesystems. */
#define NMOUNT INT_MAX
-/* Magical constants. */
-#define NOGROUP 65535 /* Marker for empty group set member. */
-#define NODEV ((dev_t) -1) /* Non-existent device. */
-
-
-/* Bit map related macros. */
-#define setbit(a,i) ((a)[(i)/NBBY] |= 1<<((i)%NBBY))
-#define clrbit(a,i) ((a)[(i)/NBBY] &= ~(1<<((i)%NBBY)))
-#define isset(a,i) ((a)[(i)/NBBY] & (1<<((i)%NBBY)))
-#define isclr(a,i) (((a)[(i)/NBBY] & (1<<((i)%NBBY))) == 0)
-
-/* Macros for counting and rounding. */
-#ifndef howmany
-# define howmany(x, y) (((x)+((y)-1))/(y))
-#endif
-#define roundup(x, y) ((((x)+((y)-1))/(y))*(y))
-#define powerof2(x) ((((x)-1)&(x))==0)
-
-/* Macros for min/max. */
-#define MIN(a,b) (((a)<(b))?(a):(b))
-#define MAX(a,b) (((a)>(b))?(a):(b))
-
-
-/* Unit of `st_blocks'. */
-#define DEV_BSIZE 512
-
-
/* Scale factor for scaled integers used to count %cpu time and load avgs.
The number of CPU `tick's that map to a unique `%age' can be expressed
diff --git a/sysdeps/mach/hurd/bits/typesizes.h b/sysdeps/mach/hurd/bits/typesizes.h
index efc13143e7..af132669ff 100644
--- a/sysdeps/mach/hurd/bits/typesizes.h
+++ b/sysdeps/mach/hurd/bits/typesizes.h
@@ -51,7 +51,6 @@
#define __USECONDS_T_TYPE __U32_TYPE
#define __SUSECONDS_T_TYPE __SLONGWORD_TYPE
#define __DADDR_T_TYPE __S32_TYPE
-#define __SWBLK_T_TYPE __SLONGWORD_TYPE
#define __KEY_T_TYPE __S32_TYPE
#define __CLOCKID_T_TYPE __S32_TYPE
#define __TIMER_T_TYPE __S32_TYPE
diff --git a/sysdeps/mach/hurd/configure b/sysdeps/mach/hurd/configure
index 3c90a665aa..84948a549c 100644
--- a/sysdeps/mach/hurd/configure
+++ b/sysdeps/mach/hurd/configure
@@ -1,128 +1,5 @@
-
-# as_fn_set_status STATUS
-# -----------------------
-# Set $? to STATUS, without forking.
-as_fn_set_status ()
-{
- return $1
-} # as_fn_set_status
-
-# as_fn_exit STATUS
-# -----------------
-# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
-as_fn_exit ()
-{
- set +e
- as_fn_set_status $1
- exit $1
-} # as_fn_exit
-if expr a : '\(a\)' >/dev/null 2>&1 &&
- test "X`expr 00001 : '.*\(...\)'`" = X001; then
- as_expr=expr
-else
- as_expr=false
-fi
-
-if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
- as_basename=basename
-else
- as_basename=false
-fi
-
-as_me=`$as_basename -- "$0" ||
-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
- X"$0" : 'X\(//\)$' \| \
- X"$0" : 'X\(/\)' \| . 2>/dev/null ||
-$as_echo X/"$0" |
- sed '/^.*\/\([^/][^/]*\)\/*$/{
- s//\1/
- q
- }
- /^X\/\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\/\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'`
-
-
- as_lineno_1=$LINENO as_lineno_1a=$LINENO
- as_lineno_2=$LINENO as_lineno_2a=$LINENO
- eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
- test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
- # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
- sed -n '
- p
- /[$]LINENO/=
- ' <$as_myself |
- sed '
- s/[$]LINENO.*/&-/
- t lineno
- b
- :lineno
- N
- :loop
- s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
- t loop
- s/-\n.*//
- ' >$as_me.lineno &&
- chmod +x "$as_me.lineno" ||
- { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
-
- # Don't try to exec as it changes $[0], causing all sort of problems
- # (the dirname of $[0] is not the place where we might find the
- # original and so on. Autoconf is especially sensitive to this).
- . "./$as_me.lineno"
- # Exit status is that of the last command.
- exit
-}
-
-
-# ac_fn_c_try_compile LINENO
-# --------------------------
-# Try to compile conftest.$ac_ext, and return whether this succeeded.
-ac_fn_c_try_compile ()
-{
- as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
- rm -f conftest.$ac_objext
- if { { ac_try="$ac_compile"
-case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_compile") 2>conftest.err
- ac_status=$?
- if test -s conftest.err; then
- grep -v '^ *+' conftest.err >conftest.er1
- cat conftest.er1 >&5
- mv -f conftest.er1 conftest.err
- fi
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && {
- test -z "$ac_c_werror_flag" ||
- test ! -s conftest.err
- } && test -s conftest.$ac_objext; then :
- ac_retval=0
-else
- $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- ac_retval=1
-fi
- eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
- as_fn_set_status $ac_retval
-
-} # ac_fn_c_try_compile
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
-# GNU libc on the Hurd is always reentrant.
-DEFINES="$DEFINES -D_LIBC_REENTRANT"
-
$as_echo "#define NO_HIDDEN 1" >>confdefs.h
diff --git a/sysdeps/mach/hurd/configure.in b/sysdeps/mach/hurd/configure.in
index 6220142265..ad915a568b 100644
--- a/sysdeps/mach/hurd/configure.in
+++ b/sysdeps/mach/hurd/configure.in
@@ -1,8 +1,5 @@
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
-# GNU libc on the Hurd is always reentrant.
-DEFINES="$DEFINES -D_LIBC_REENTRANT"
-
dnl We need this setting because of the need for PLT calls in ld.so.
AC_DEFINE([NO_HIDDEN])
diff --git a/sysdeps/mach/hurd/dl-sysdep.c b/sysdeps/mach/hurd/dl-sysdep.c
index 0fdeeac094..78269d2623 100644
--- a/sysdeps/mach/hurd/dl-sysdep.c
+++ b/sysdeps/mach/hurd/dl-sysdep.c
@@ -660,26 +660,6 @@ _dl_show_auxv (void)
}
-/* Return an array of useful/necessary hardware capability names. */
-const struct r_strlenpair *
-internal_function
-_dl_important_hwcaps (const char *platform, size_t platform_len, size_t *sz,
- size_t *max_capstrlen)
-{
- struct r_strlenpair *result;
-
- /* Return an empty array. Hurd has no hardware capabilities. */
- result = (struct r_strlenpair *) malloc (sizeof (*result));
- if (result == NULL)
- _dl_signal_error (ENOMEM, NULL, NULL, "cannot create capability list");
-
- result[0].str = (char *) result; /* Does not really matter. */
- result[0].len = 0;
-
- *sz = 1;
- return result;
-}
-
void weak_function
_dl_init_first (int argc, ...)
{
diff --git a/sysdeps/mach/hurd/eloop-threshold.h b/sysdeps/mach/hurd/eloop-threshold.h
new file mode 100644
index 0000000000..b8fae16449
--- /dev/null
+++ b/sysdeps/mach/hurd/eloop-threshold.h
@@ -0,0 +1,37 @@
+/* Threshold at which to diagnose ELOOP. Hurd version.
+ Copyright (C) 2012 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _ELOOP_THRESHOLD_H
+#define _ELOOP_THRESHOLD_H 1
+
+/* Return the maximum number of symlink traversals to permit
+ before diagnosing ELOOP.
+
+ In the Hurd version, here we are actually setting the only policy
+ there is on the system. We use a literal number here rather than
+ defining SYMLOOP_MAX so that programs don't compile in a number
+ but instead use sysconf and the number can be changed here to
+ affect sysconf's result. */
+
+static inline unsigned int __attribute__ ((const))
+__eloop_threshold (void)
+{
+ return 32;
+}
+
+#endif /* eloop-threshold.h */
diff --git a/sysdeps/mach/hurd/fdatasync.c b/sysdeps/mach/hurd/fdatasync.c
index 19d7a4a58a..22c1d103d4 100644
--- a/sysdeps/mach/hurd/fdatasync.c
+++ b/sysdeps/mach/hurd/fdatasync.c
@@ -26,6 +26,12 @@ fdatasync (int fd)
{
error_t err = HURD_DPORT_USE (fd, __file_sync (port, 1, 1));
if (err)
- return __hurd_dfail (fd, err);
+ {
+ if (err == EOPNOTSUPP)
+ /* If the file descriptor does not support sync, return EINVAL
+ as POSIX specifies. */
+ err = EINVAL;
+ return __hurd_dfail (fd, err);
+ }
return 0;
}
diff --git a/sysdeps/mach/hurd/fsync.c b/sysdeps/mach/hurd/fsync.c
index a474c8a356..fe3e044a3a 100644
--- a/sysdeps/mach/hurd/fsync.c
+++ b/sysdeps/mach/hurd/fsync.c
@@ -27,6 +27,12 @@ fsync (fd)
{
error_t err = HURD_DPORT_USE (fd, __file_sync (port, 1, 0));
if (err)
- return __hurd_dfail (fd, err);
+ {
+ if (err == EOPNOTSUPP)
+ /* If the file descriptor does not support sync, return EINVAL
+ as POSIX specifies. */
+ err = EINVAL;
+ return __hurd_dfail (fd, err);
+ }
return 0;
}
diff --git a/sysdeps/mach/hurd/malloc-machine.h b/sysdeps/mach/hurd/malloc-machine.h
index 4a8bd16e6c..16e054fe5d 100644
--- a/sysdeps/mach/hurd/malloc-machine.h
+++ b/sysdeps/mach/hurd/malloc-machine.h
@@ -66,8 +66,9 @@ __libc_tsd_define (static, void *, MALLOC) /* declaration/common definition */
#include <sys/mman.h>
-#undef madvise
-#define madvise(addr, len, advice) ((void) (addr), (void) (len), (void) (advice))
+#undef __madvise
+#define __madvise(addr, len, advice) \
+ ((void) (addr), (void) (len), (void) (advice))
#include <sysdeps/generic/malloc-machine.h>
diff --git a/sysdeps/mach/hurd/ptrace.c b/sysdeps/mach/hurd/ptrace.c
index bb5627284d..bccb265fbf 100644
--- a/sysdeps/mach/hurd/ptrace.c
+++ b/sysdeps/mach/hurd/ptrace.c
@@ -160,7 +160,7 @@ ptrace (enum __ptrace_request request, ... )
case PTRACE_SINGLESTEP:
/* This is a machine-dependent kernel RPC on
machines that support it. Punt. */
- return EOPNOTSUPP;
+ return __hurd_fail (EOPNOTSUPP);
case PTRACE_ATTACH:
case PTRACE_DETACH:
@@ -227,7 +227,7 @@ ptrace (enum __ptrace_request request, ... )
case PTRACE_PEEKUSER:
case PTRACE_POKEUSER:
/* U area, what's that? */
- return EOPNOTSUPP;
+ return __hurd_fail (EOPNOTSUPP);
case PTRACE_GETREGS:
case PTRACE_SETREGS:
@@ -248,7 +248,7 @@ ptrace (enum __ptrace_request request, ... )
return get_regs (MACHINE_THREAD_FLOAT_STATE_FLAVOR,
MACHINE_THREAD_FLOAT_STATE_COUNT);
#else
- return EOPNOTSUPP;
+ return __hurd_fail (EOPNOTSUPP);
#endif
case PTRACE_GETFPAREGS:
@@ -261,7 +261,7 @@ ptrace (enum __ptrace_request request, ... )
return get_regs (MACHINE_THREAD_FPA_STATE_FLAVOR,
MACHINE_THREAD_FPA_STATE_COUNT);
#else
- return EOPNOTSUPP;
+ return __hurd_fail (EOPNOTSUPP);
#endif
case PTRACE_POKETEXT:
diff --git a/sysdeps/mach/hurd/renameat.c b/sysdeps/mach/hurd/renameat.c
new file mode 100644
index 0000000000..8ab5906a67
--- /dev/null
+++ b/sysdeps/mach/hurd/renameat.c
@@ -0,0 +1,51 @@
+/* Rename a file using relative source and destination names. Hurd version.
+ Copyright (C) 1991-2012 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 Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 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
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <stdio.h>
+#include <hurd.h>
+#include <hurd/fd.h>
+
+/* Rename the file OLD relative to OLDFD to NEW relative to NEWFD. */
+int
+renameat (oldfd, old, newfd, new)
+ int oldfd;
+ const char *old;
+ int newfd;
+ const char *new;
+{
+ error_t err;
+ file_t olddir, newdir;
+ const char *oldname, *newname;
+
+ olddir = __directory_name_split_at (oldfd, old, (char **) &oldname);
+ if (olddir == MACH_PORT_NULL)
+ return -1;
+ newdir = __directory_name_split_at (newfd, new, (char **) &newname);
+ if (newdir == MACH_PORT_NULL)
+ {
+ __mach_port_deallocate (__mach_task_self (), olddir);
+ return -1;
+ }
+
+ err = __dir_rename (olddir, oldname, newdir, newname, 0);
+ __mach_port_deallocate (__mach_task_self (), olddir);
+ __mach_port_deallocate (__mach_task_self (), newdir);
+ if (err)
+ return __hurd_fail (err);
+ return 0;
+}
diff --git a/sysdeps/mach/hurd/dl-cache.c b/sysdeps/mach/hurd/sysconf.c
index 5c01c3d6dd..6d1666d93c 100644
--- a/sysdeps/mach/hurd/dl-cache.c
+++ b/sysdeps/mach/hurd/sysconf.c
@@ -1,5 +1,5 @@
-/* Stubby version of dl-cache; the Hurd doesn't support this "feature".
- Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Return values of system parameters. Hurd version.
+ Copyright (C) 2012 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
@@ -16,13 +16,11 @@
License along with the GNU C Library; if not, see
<http://www.gnu.org/licenses/>. */
-const char *
-_dl_load_cache_lookup (const char *name)
-{
- return 0;
-}
+#include <limits.h>
+#include <unistd.h>
-void
-_dl_unload_cache (void)
-{
-}
+#include <eloop-threshold.h>
+
+#define SYMLOOP_MAX (__eloop_threshold ())
+
+#include <sysdeps/posix/sysconf.c>