diff --git a/ChangeLog.arm b/ChangeLog.arm index cf88eda65a..53359c63aa 100644 --- a/ChangeLog.arm +++ b/ChangeLog.arm @@ -1,3 +1,9 @@ +2012-05-14 Joseph Myers + + * sysdeps/unix/sysv/linux/arm/sigaction.c + [!__ASSUME_REALTIME_SIGNALS]: Remove conditional code. + [__ASSUME_REALTIME_SIGNALS]: Make code unconditional. + 2012-05-07 Carlos O'Donell * sysdeps/arm/configure.in: Set libc_cv_arm_pcs_vfp. diff --git a/ChangeLog.ia64 b/ChangeLog.ia64 index 11ba030450..fd90f34143 100644 --- a/ChangeLog.ia64 +++ b/ChangeLog.ia64 @@ -1,3 +1,7 @@ +2012-05-14 Mike Frysinger + + * sysdeps/ia64/fpu/libm-symbols.h: Delete __ELF__ checks. + 2012-05-07 Mike Frysinger * sysdeps/unix/sysv/linux/ia64/sysdep.h: Include errno.h. diff --git a/ChangeLog.m68k b/ChangeLog.m68k index 2a44afe8b9..3c912da2f7 100644 --- a/ChangeLog.m68k +++ b/ChangeLog.m68k @@ -1,3 +1,8 @@ +2012-05-14 Andreas Schwab + + * sysdeps/unix/sysv/linux/m68k/configure.in (arch_minimum_kernel) + [$machine != m68k/coldfire]: Don't set. + 2012-05-10 Andreas Schwab * sysdeps/m68k/m680x0/fpu/libm-test-ulps: Update. diff --git a/ChangeLog.mips b/ChangeLog.mips index 89422839c2..db20a788ae 100644 --- a/ChangeLog.mips +++ b/ChangeLog.mips @@ -1,3 +1,25 @@ +2012-05-14 Joseph Myers + + * sysdeps/unix/sysv/linux/mips/pread.c [!__ASSUME_PREAD_SYSCALL]: + Remove conditional code. + [__ASSUME_PREAD_SYSCALL]: Make code unconditional. + * sysdeps/unix/sysv/linux/mips/pread64.c + [!__ASSUME_PREAD_SYSCALL]: Remove conditional code. + [__ASSUME_PREAD_SYSCALL]: Make code unconditional. + * sysdeps/unix/sysv/linux/mips/pwrite.c + [!__ASSUME_PWRITE_SYSCALL]: Remove conditional code. + [__ASSUME_PWRITE_SYSCALL]: Make code unconditional. + * sysdeps/unix/sysv/linux/mips/pwrite64.c + [!__ASSUME_PWRITE_SYSCALL]: Remove conditional code. + [__ASSUME_PWRITE_SYSCALL]: Make code unconditional. + * sysdeps/unix/sysv/linux/mips/sigaction.c + [!__ASSUME_REALTIME_SIGNALS]: Remove conditional code. + [__ASSUME_REALTIME_SIGNALS]: Make code unconditional. + +2012-05-11 Joseph Myers + + * sysdeps/mips/dl-lookup.c: Update from generic version. + 2012-05-08 Joseph Myers * sysdeps/mips/fpu/libm-test-ulps: Move to ... diff --git a/sysdeps/ia64/fpu/libm-symbols.h b/sysdeps/ia64/fpu/libm-symbols.h index 5b5e4b7d7b..81084bd62e 100644 --- a/sysdeps/ia64/fpu/libm-symbols.h +++ b/sysdeps/ia64/fpu/libm-symbols.h @@ -3,13 +3,8 @@ /* Support for compatible assembler handling. */ -#ifdef __ELF__ -# define ASM_SIZE_DIRECTIVE(name) .size name,.-name -# define ASM_TYPE_DIRECTIVE(name,T) .type name,T -#else -# define ASM_SIZE_DIRECTIVE(name) -# define ASM_TYPE_DIRECTIVE(name,T) -#endif +#define ASM_SIZE_DIRECTIVE(name) .size name,.-name +#define ASM_TYPE_DIRECTIVE(name,T) .type name,T #define LOCAL_LIBM_ENTRY(name) \ .proc name; \ diff --git a/sysdeps/mips/dl-lookup.c b/sysdeps/mips/dl-lookup.c index c39a2b06de..f7e98b7f53 100644 --- a/sysdeps/mips/dl-lookup.c +++ b/sysdeps/mips/dl-lookup.c @@ -14,7 +14,7 @@ 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 + License along with the GNU C Library; if not, see . */ #include @@ -786,7 +786,8 @@ _dl_lookup_symbol_x (const char *undef_name, struct link_map *undef_map, if (__builtin_expect (current_value.s == NULL, 0)) { if ((*ref == NULL || ELFW(ST_BIND) ((*ref)->st_info) != STB_WEAK) - && skip_map == NULL) + && skip_map == NULL + && !(GLRO(dl_debug_mask) & DL_DEBUG_UNUSED)) { /* We could find no value for a strong reference. */ const char *reference_name = undef_map ? undef_map->l_name : ""; diff --git a/sysdeps/unix/sysv/linux/arm/sigaction.c b/sysdeps/unix/sysv/linux/arm/sigaction.c index e7b51c6275..76037cb468 100644 --- a/sysdeps/unix/sysv/linux/arm/sigaction.c +++ b/sysdeps/unix/sysv/linux/arm/sigaction.c @@ -28,10 +28,6 @@ translate it here. */ #include -/* The variable is shared between all wrappers around signal handling - functions which have RT equivalents. */ -int __libc_missing_rt_sigs; - #define SA_RESTORER 0x04000000 extern void __default_sa_restorer_v1(void); @@ -69,97 +65,42 @@ __libc_sigaction (sig, act, oact) const struct sigaction *act; struct sigaction *oact; { -#ifndef __ASSUME_REALTIME_SIGNALS - struct old_kernel_sigaction k_sigact, k_osigact; -#endif int result; -#ifdef __NR_rt_sigaction - /* First try the RT signals. */ -# ifndef __ASSUME_REALTIME_SIGNALS - if (!__libc_missing_rt_sigs) -# endif - { - struct kernel_sigaction kact, koact; -# ifndef __ASSUME_REALTIME_SIGNALS - int saved_errno = errno; -# endif + struct kernel_sigaction kact, koact; - if (act) - { - kact.k_sa_handler = act->sa_handler; - memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t)); - kact.sa_flags = act->sa_flags; -# ifdef HAVE_SA_RESTORER - if (kact.sa_flags & SA_RESTORER) - kact.sa_restorer = act->sa_restorer; - else - { - kact.sa_restorer = choose_restorer (kact.sa_flags); - kact.sa_flags |= SA_RESTORER; - } -# endif - } - - /* XXX The size argument hopefully will have to be changed to the - real size of the user-level sigset_t. */ - result = INLINE_SYSCALL (rt_sigaction, 4, sig, - act ? __ptrvalue (&kact) : NULL, - oact ? __ptrvalue (&koact) : NULL, _NSIG / 8); - -# ifndef __ASSUME_REALTIME_SIGNALS - if (result >= 0 || errno != ENOSYS) -# endif - { - if (oact && result >= 0) - { - oact->sa_handler = koact.k_sa_handler; - memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t)); - oact->sa_flags = koact.sa_flags; -# ifdef HAVE_SA_RESTORER - oact->sa_restorer = koact.sa_restorer; -# endif - } - return result; - } - -# ifndef __ASSUME_REALTIME_SIGNALS - __set_errno (saved_errno); - __libc_missing_rt_sigs = 1; -# endif - } -#endif - -#ifndef __ASSUME_REALTIME_SIGNALS 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 - if (k_sigact.sa_flags & SA_RESTORER) - k_sigact.sa_restorer = act->sa_restorer; + kact.k_sa_handler = act->sa_handler; + memcpy (&kact.sa_mask, &act->sa_mask, sizeof (sigset_t)); + kact.sa_flags = act->sa_flags; +#ifdef HAVE_SA_RESTORER + if (kact.sa_flags & SA_RESTORER) + kact.sa_restorer = act->sa_restorer; else { - k_sigact.sa_restorer = choose_restorer (k_sigact.sa_flags); - k_sigact.sa_flags |= SA_RESTORER; + kact.sa_restorer = choose_restorer (kact.sa_flags); + kact.sa_flags |= SA_RESTORER; } -# endif +#endif } - result = INLINE_SYSCALL (sigaction, 3, sig, - act ? __ptrvalue (&k_sigact) : NULL, - oact ? __ptrvalue (&k_osigact) : NULL); + + /* XXX The size argument hopefully will have to be changed to the + real size of the user-level sigset_t. */ + result = INLINE_SYSCALL (rt_sigaction, 4, sig, + act ? __ptrvalue (&kact) : NULL, + oact ? __ptrvalue (&koact) : NULL, _NSIG / 8); + if (oact && result >= 0) { - 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 - oact->sa_restorer = k_osigact.sa_restorer; -# endif + oact->sa_handler = koact.k_sa_handler; + memcpy (&oact->sa_mask, &koact.sa_mask, sizeof (sigset_t)); + oact->sa_flags = koact.sa_flags; +#ifdef HAVE_SA_RESTORER + oact->sa_restorer = koact.sa_restorer; +#endif } return result; -#endif } libc_hidden_def (__libc_sigaction) diff --git a/sysdeps/unix/sysv/linux/m68k/configure b/sysdeps/unix/sysv/linux/m68k/configure index 708b7a1a3c..a2fd833321 100644 --- a/sysdeps/unix/sysv/linux/m68k/configure +++ b/sysdeps/unix/sysv/linux/m68k/configure @@ -4,7 +4,6 @@ m68k/coldfire) arch_minimum_kernel=2.6.10 ;; *) - arch_minimum_kernel=2.0.10 libc_cv_gcc_unwind_find_fde=yes ;; esac diff --git a/sysdeps/unix/sysv/linux/m68k/configure.in b/sysdeps/unix/sysv/linux/m68k/configure.in index b25f4dbb7f..6e91ef96f3 100644 --- a/sysdeps/unix/sysv/linux/m68k/configure.in +++ b/sysdeps/unix/sysv/linux/m68k/configure.in @@ -5,7 +5,6 @@ m68k/coldfire) arch_minimum_kernel=2.6.10 ;; *) - arch_minimum_kernel=2.0.10 libc_cv_gcc_unwind_find_fde=yes ;; esac diff --git a/sysdeps/unix/sysv/linux/m68k/kernel-features.h b/sysdeps/unix/sysv/linux/m68k/kernel-features.h index 3fffa0801b..2d8882e556 100644 --- a/sysdeps/unix/sysv/linux/m68k/kernel-features.h +++ b/sysdeps/unix/sysv/linux/m68k/kernel-features.h @@ -25,7 +25,6 @@ # define __ASSUME_FCNTL64 1 # define __ASSUME_VFORK_SYSCALL 1 # define __ASSUME_NEW_GETRLIMIT_SYSCALL 1 -# define __ASSUME_VFORK_SYSCALL 1 #endif /* Many syscalls were added in 2.6.10 for m68k. */ diff --git a/sysdeps/unix/sysv/linux/mips/pread.c b/sysdeps/unix/sysv/linux/mips/pread.c index ff83498caf..a868130ea1 100644 --- a/sysdeps/unix/sysv/linux/mips/pread.c +++ b/sysdeps/unix/sysv/linux/mips/pread.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -38,12 +37,6 @@ # define __NR_pread __NR_pread64 #endif -#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 __libc_pread (fd, buf, count, offset) @@ -60,7 +53,6 @@ __libc_pread (fd, buf, count, offset) if (SINGLE_THREAD_P) { - /* First try the syscall. */ #if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); @@ -68,28 +60,17 @@ __libc_pread (fd, buf, count, offset) result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR (offset >> 31, offset)); #endif -# 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; } int oldtype = LIBC_CANCEL_ASYNC (); - /* First try the syscall. */ #if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); #else result = INLINE_SYSCALL (pread, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR (offset >> 31, offset)); #endif -# 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 LIBC_CANCEL_RESET (oldtype); @@ -98,11 +79,3 @@ __libc_pread (fd, buf, count, offset) strong_alias (__libc_pread, __pread) weak_alias (__libc_pread, pread) - -# define __libc_pread(fd, buf, count, offset) \ - static internal_function __emulate_pread (fd, buf, count, offset) -#endif - -#if __ASSUME_PREAD_SYSCALL == 0 -# include -#endif diff --git a/sysdeps/unix/sysv/linux/mips/pread64.c b/sysdeps/unix/sysv/linux/mips/pread64.c index 05c7c14ead..6f9b0054a5 100644 --- a/sysdeps/unix/sysv/linux/mips/pread64.c +++ b/sysdeps/unix/sysv/linux/mips/pread64.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -37,12 +36,6 @@ # define __NR_pread __NR_pread64 #endif -#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 __libc_pread64 (fd, buf, count, offset) @@ -56,7 +49,6 @@ __libc_pread64 (fd, buf, count, offset) if (SINGLE_THREAD_P) { - /* First try the syscall. */ #if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); @@ -65,17 +57,11 @@ __libc_pread64 (fd, buf, count, offset) __LONG_LONG_PAIR ((off_t) (offset >> 32), (off_t) (offset & 0xffffffff))); #endif -# 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; } int oldtype = LIBC_CANCEL_ASYNC (); - /* First try the syscall. */ #if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 result = INLINE_SYSCALL (pread, 4, fd, CHECK_N (buf, count), count, offset); #else @@ -83,11 +69,6 @@ __libc_pread64 (fd, buf, count, offset) __LONG_LONG_PAIR ((off_t) (offset >> 32), (off_t) (offset & 0xffffffff))); #endif -# 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 LIBC_CANCEL_RESET (oldtype); @@ -96,11 +77,3 @@ __libc_pread64 (fd, buf, count, offset) weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, pread64) - -# define __libc_pread64(fd, buf, count, offset) \ - static internal_function __emulate_pread64 (fd, buf, count, offset) -#endif - -#if __ASSUME_PREAD_SYSCALL == 0 -# include -#endif diff --git a/sysdeps/unix/sysv/linux/mips/pwrite.c b/sysdeps/unix/sysv/linux/mips/pwrite.c index 07331f0654..cc0c3b7c22 100644 --- a/sysdeps/unix/sysv/linux/mips/pwrite.c +++ b/sysdeps/unix/sysv/linux/mips/pwrite.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1997. @@ -38,12 +37,6 @@ # define __NR_pwrite __NR_pwrite64 #endif -#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 __libc_pwrite (fd, buf, count, offset) @@ -60,7 +53,6 @@ __libc_pwrite (fd, buf, count, offset) if (SINGLE_THREAD_P) { - /* First try the syscall. */ #if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); @@ -68,28 +60,17 @@ __libc_pwrite (fd, buf, count, offset) result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR (offset >> 31, offset)); #endif -# 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; } int oldtype = LIBC_CANCEL_ASYNC (); - /* First try the syscall. */ #if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); #else result = INLINE_SYSCALL (pwrite, 6, fd, CHECK_N (buf, count), count, 0, __LONG_LONG_PAIR (offset >> 31, offset)); #endif -# 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 LIBC_CANCEL_RESET (oldtype); @@ -98,11 +79,3 @@ __libc_pwrite (fd, buf, count, offset) strong_alias (__libc_pwrite, __pwrite) weak_alias (__libc_pwrite, pwrite) - -# define __libc_pwrite(fd, buf, count, offset) \ - static internal_function __emulate_pwrite (fd, buf, count, offset) -#endif - -#if __ASSUME_PWRITE_SYSCALL == 0 -# include -#endif diff --git a/sysdeps/unix/sysv/linux/mips/pwrite64.c b/sysdeps/unix/sysv/linux/mips/pwrite64.c index 39bbda8f0e..d60accd57f 100644 --- a/sysdeps/unix/sysv/linux/mips/pwrite64.c +++ b/sysdeps/unix/sysv/linux/mips/pwrite64.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1997, 1998, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. +/* Copyright (C) 1997-2012 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ralf Baechle , 1998. @@ -37,12 +36,6 @@ # define __NR_pwrite __NR_pwrite64 #endif -#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 __libc_pwrite64 (fd, buf, count, offset) @@ -55,7 +48,6 @@ __libc_pwrite64 (fd, buf, count, offset) if (SINGLE_THREAD_P) { - /* First try the syscall. */ #if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); @@ -64,18 +56,12 @@ __libc_pwrite64 (fd, buf, count, offset) __LONG_LONG_PAIR ((off_t) (offset >> 32), (off_t) (offset & 0xffffffff))); #endif -# 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; } int oldtype = LIBC_CANCEL_ASYNC (); - /* First try the syscall. */ #if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 result = INLINE_SYSCALL (pwrite, 4, fd, CHECK_N (buf, count), count, offset); #else @@ -83,11 +69,6 @@ __libc_pwrite64 (fd, buf, count, offset) __LONG_LONG_PAIR ((off_t) (offset >> 32), (off_t) (offset & 0xffffffff))); #endif -# 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 LIBC_CANCEL_RESET (oldtype); @@ -97,11 +78,3 @@ __libc_pwrite64 (fd, buf, count, offset) weak_alias (__libc_pwrite64, __pwrite64) libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64) - -# define __libc_pwrite64(fd, buf, count, offset) \ - static internal_function __emulate_pwrite64 (fd, buf, count, offset) -#endif - -#if __ASSUME_PWRITE_SYSCALL == 0 -# include -#endif diff --git a/sysdeps/unix/sysv/linux/mips/sigaction.c b/sysdeps/unix/sysv/linux/mips/sigaction.c index c3a467003a..d646af3f22 100644 --- a/sysdeps/unix/sysv/linux/mips/sigaction.c +++ b/sysdeps/unix/sysv/linux/mips/sigaction.c @@ -1,5 +1,4 @@ -/* Copyright (C) 1997,1998,1999,2000,2002,2003,2004,2006 - Free Software Foundation, Inc. +/* Copyright (C) 1997-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 @@ -33,13 +32,6 @@ translate it here. */ #include -#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; - -#endif - #if _MIPS_SIM != _ABIO32 # ifdef __NR_rt_sigreturn @@ -58,97 +50,42 @@ __libc_sigaction (sig, act, oact) const struct sigaction *act; struct sigaction *oact; { -#if __ASSUME_REALTIME_SIGNALS == 0 - struct old_kernel_sigaction k_sigact, k_osigact; -#endif int result; -#if defined __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 + struct kernel_sigaction kact, koact; - if (act) - { - kact.k_sa_handler = act->sa_handler; - memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kernel_sigset_t)); - kact.sa_flags = act->sa_flags; -# ifdef HAVE_SA_RESTORER -# if _MIPS_SIM == _ABIO32 - kact.sa_restorer = act->sa_restorer; -# else - kact.sa_restorer = &restore_rt; -# endif -# endif - } - - /* XXX The size argument hopefully will have to be changed to the - real size of the user-level sigset_t. */ - result = INLINE_SYSCALL (rt_sigaction, 4, sig, - act ? __ptrvalue (&kact) : NULL, - oact ? __ptrvalue (&koact) : NULL, - sizeof (kernel_sigset_t)); - -# if __ASSUME_REALTIME_SIGNALS == 0 - if (result >= 0 || errno != ENOSYS) -# endif - { - if (oact && result >= 0) - { - oact->sa_handler = koact.k_sa_handler; - memcpy (&oact->sa_mask, &koact.sa_mask, - sizeof (kernel_sigset_t)); - oact->sa_flags = koact.sa_flags; -# ifdef HAVE_SA_RESTORER - oact->sa_restorer = koact.sa_restorer; -# endif - } - 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 - k_sigact.sa_restorer = act->sa_restorer; + kact.k_sa_handler = act->sa_handler; + memcpy (&kact.sa_mask, &act->sa_mask, sizeof (kernel_sigset_t)); + kact.sa_flags = act->sa_flags; +#ifdef HAVE_SA_RESTORER +# if _MIPS_SIM == _ABIO32 + kact.sa_restorer = act->sa_restorer; +# else + kact.sa_restorer = &restore_rt; # endif +#endif } - result = INLINE_SYSCALL (sigaction, 3, sig, - act ? __ptrvalue (&k_sigact) : NULL, - oact ? __ptrvalue (&k_osigact) : NULL); + + /* XXX The size argument hopefully will have to be changed to the + real size of the user-level sigset_t. */ + result = INLINE_SYSCALL (rt_sigaction, 4, sig, + act ? __ptrvalue (&kact) : NULL, + oact ? __ptrvalue (&koact) : NULL, + sizeof (kernel_sigset_t)); + if (oact && result >= 0) { - 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 -# if _MIPS_SIM == _ABIO32 - oact->sa_restorer = k_osigact.sa_restorer; -# else - oact->sa_restorer = &restore; -# endif -# endif + oact->sa_handler = koact.k_sa_handler; + memcpy (&oact->sa_mask, &koact.sa_mask, + sizeof (kernel_sigset_t)); + oact->sa_flags = koact.sa_flags; +#ifdef HAVE_SA_RESTORER + oact->sa_restorer = koact.sa_restorer; +#endif } return result; -#endif } libc_hidden_def (__libc_sigaction)