This is the mail archive of the
libc-ports@sources.redhat.com
mailing list for the libc-ports project.
[ARM,MIPS] Remove pre-2.2 kernel support
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: libc-ports at sourceware dot org
- Cc: Richard Henderson <rth at twiddle dot net>, Andreas Schwab <schwab at linux-m68k dot org>
- Date: Mon, 14 May 2012 14:21:33 +0000 (UTC)
- Subject: [ARM,MIPS] Remove pre-2.2 kernel support
In line with a libc patch I've now committed, I've applied these ARM and
MIPS ports changes to remove support for pre-2.2 kernels (which was
already dead since those ports don't allow configuring for kernels before
2.6.16 and 2.6.12 respectively).
Alpha and M68K maintainers should note what I said in
<http://sourceware.org/ml/libc-alpha/2012-05/msg00380.html>:
M68K should change its arch_minimum_kernel to 2.2.0 or later; alpha's
kernel-features.h defines an alpha-specific __ASSUME_TIMEVAL64 for 2.2.0
and later and all the alpha-specific code conditioned on that can have
conditions removed (actually, those conditions are already dead; alpha
requires 2.6.0 as arch_minimum_kernel and has 2.6.9 the documented minimum
kernel for NPTL in README).
diff --git a/ChangeLog.arm b/ChangeLog.arm
index cf88eda..53359c6 100644
--- a/ChangeLog.arm
+++ b/ChangeLog.arm
@@ -1,3 +1,9 @@
+2012-05-14 Joseph Myers <joseph@codesourcery.com>
+
+ * 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 <carlos_odonell@mentor.com>
* sysdeps/arm/configure.in: Set libc_cv_arm_pcs_vfp.
diff --git a/ChangeLog.mips b/ChangeLog.mips
index eb61f04..db20a78 100644
--- a/ChangeLog.mips
+++ b/ChangeLog.mips
@@ -1,3 +1,21 @@
+2012-05-14 Joseph Myers <joseph@codesourcery.com>
+
+ * 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 <joseph@codesourcery.com>
* sysdeps/mips/dl-lookup.c: Update from generic version.
diff --git a/sysdeps/unix/sysv/linux/arm/sigaction.c b/sysdeps/unix/sysv/linux/arm/sigaction.c
index e7b51c6..76037cb 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 <kernel_sigaction.h>
-/* 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
-
- 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
+ struct kernel_sigaction kact, koact;
-#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/mips/pread.c b/sysdeps/unix/sysv/linux/mips/pread.c
index ff83498..a868130 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 <drepper@cygnus.com>, 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 <sysdeps/posix/pread.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/pread64.c b/sysdeps/unix/sysv/linux/mips/pread64.c
index 05c7c14..6f9b005 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 <drepper@cygnus.com>, 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 <sysdeps/posix/pread64.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/pwrite.c b/sysdeps/unix/sysv/linux/mips/pwrite.c
index 07331f0..cc0c3b7 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 <drepper@cygnus.com>, 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 <sysdeps/posix/pwrite.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/pwrite64.c b/sysdeps/unix/sysv/linux/mips/pwrite64.c
index 39bbda8..d60accd 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 <ralf@gnu.org>, 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 <sysdeps/posix/pwrite64.c>
-#endif
diff --git a/sysdeps/unix/sysv/linux/mips/sigaction.c b/sysdeps/unix/sysv/linux/mips/sigaction.c
index c3a4670..d646af3 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 <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;
-
-#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
-
- 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));
+ struct kernel_sigaction kact, koact;
-# 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)
--
Joseph S. Myers
joseph@codesourcery.com