+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.
-/* 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.
# 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)
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);
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);
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
-/* 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.
# 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)
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);
__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
__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);
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
-/* 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.
# 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)
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);
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);
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
-/* 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.
# 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)
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);
__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
__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);
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
-/* 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
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
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)