]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
nptl: Rewrite cancellation macros
authorAdhemerval Zanella <azanella@linux.vnet.ibm.com>
Sun, 28 Sep 2014 11:46:23 +0000 (08:46 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 4 Jun 2015 21:58:36 +0000 (18:58 -0300)
This patch changes the way cancellation entrypoints are defined to
instead call the macro SYSCALL_CANCEL.  An usual cnacellation definition
is defined as:

  if (SINGLE_THREAD_P)
    return INLINE_SYSCALL (syscall, NARGS, args...)

  int oldtype = LIBC_CANCEL_ASYNC ();

  return INLINE_SYSCALL (syscall, NARGS, args...)

  LIBC_CANCEL_RESET (oldtype);

And it is rewrited as just:

  SYSCALL_CANCEL (syscall, args...)

The idea is to remove LIBC_CANCEL_ASYNC/LIBC_CANCEL_RESET explicit
usage.

Tested on i386, x86_64, powerpc32, powerpc64le, arm, and aarch64.

* sysdeps/unix/sysdep.h [SYSCALL_CANCEL]: New macro: define
cancellable syscalls.
(SYS_ify): Add guard to no redefine it.
(INLINE_SYSCALL): Likewise.
* sysdeps/unix/sysv/linux/accept4.c (accept4): Remove
LIBC_CANCEL_ASYNC/INLINE_SYSCALL/LIBC_CANCEL_RESET and use
SYSCALL_CANCEL instead.
* sysdeps/unix/sysv/linux/alpha/fdatasync.c (__fdatasync): Likewise.
* sysdeps/unix/sysv/linux/arm/pread.c (__libc_pread): Likewise.
* sysdeps/unix/sysv/linux/arm/pread64.c (__libc_pread64): Likewise.
* sysdeps/unix/sysv/linux/arm/pwrite.c (__libc_pwrite): Likewise.
* sysdeps/unix/sysv/linux/arm/pwrite64.c (__libc_pwrite64): Likewise.
* sysdeps/unix/sysv/linux/epoll_pwait.c (epoll_pwait): Likewise.
* sysdeps/unix/sysv/linux/fallocate.c (fallocate): Likewise.
* sysdeps/unix/sysv/linux/fallocate64.c (fallocate64): Likewise.
* sysdeps/unix/sysv/linux/generic/open.c (__libc_open): Likewise.
* sysdeps/unix/sysv/linux/generic/open64.c (__libc_open64): Likewise.
* sysdeps/unix/sysv/linux/generic/pause.c (__libc_pause): Likewise.
* sysdeps/unix/sysv/linux/generic/poll.c (__poll): Likewise.
* sysdeps/unix/sysv/linux/generic/recv.c (__libc_recv): Likewise.
* sysdeps/unix/sysv/linux/generic/select.c (__select): Likewise.
* sysdeps/unix/sysv/linux/generic/send.c (__libc_send): Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c (__libc_pread):
Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c
(__libc_pread64): Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c
(__libc_preadv): Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c
(__libc_readv64): Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c
(__libc_pwrite): Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c
(__libc_pwrite64): Likewise.
* sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c
(__libc_pwritev): Likewise.
* sysdeps/sysv/linux/generic/wordsize-32/pwritev64.c
(__libc_pwritev64): Likewise.
* sysdeps/unix/sysv/linux/i386/fcntl.c (__libc_fcntl): Likewise.
* sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
(sync_file_range): Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c (fallocate):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c (fallocate64):
Likewise.
* sysdeps/unix/sysv/linux/mips/pread.c (__libc_pread): Likewise.
* sysdeps/unix/sysv/linux/mips/pread64.c (__libc_pread64): Likewise.
* sysdeps/unix/sysv/linux/mips/pwrite.c (__libc_pwrite): Likewise.
* sysdeps/unix/sysv/linux/mips/pwrite64.c (__libc_pwrite64): Likewise.
* sysdeps/unix/sysv/linux/msgrcv.c (__libc_msgrcv): Likewise.
* sysdeps/unix/sysv/linux/msgsnd.c (__libc_msgsnd): Likewise.
* sysdeps/unix/sysv/linux/open64.c (__libc_open64): Likewise.
* sysdeps/unix/sysv/linux/openat.c (__libc_openat): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c (__libc_pread):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
(__libc_read64): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c (__libc_write):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c (__libc_write64):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c (__libc_fcntl):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c (__libc_pread):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c
(__libc_pread64): Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c (__libc_pwrite):
Likewise.
* sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c
(__libc_pwrite64): Likewise.
* sysdeps/sysv/linux/powerpc/powerpc64/sync_file_range.c
(sync_file_range): Likewise.
* sysdeps/unix/sysv/linux/ppoll.c (ppoll): Likewise.
* sysdeps/unix/sysv/linux/pread.c (__libc_pread): Likewise.
* sysdeps/unix/sysv/linux/pread64.c (__libc_pread64): Likewise.
* sysdeps/unix/sysv/linux/preadv.c (__libc_preadv): Likewise.
* sysdeps/unix/sysv/linux/pselect.c (__pselect): Likewise.
* sysdeps/unix/sysv/linux/pwrite.c (__libc_pwrite): Likewise.
* sysdeps/unix/sysv/linux/pwrite64.c (__libc_pwrite64): Likewise.
* sysdeps/unix/sysv/linux/pwritev.c (PWRITEV): Likewise.
* sysdeps/unix/sysv/linux/readv.c (__libc_readv): Likewise.
* sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Likewise.
* sysdeps/unix/sysv/linux/sendmmsg.c (sendmmsg): Likewise.
* sysdeps/unix/sysv/linux/sh/pread.c (__libc_pread): Likewise.
* sysdeps/unix/sysv/linux/sh/pread64.c (__libc_pread64): Likewise.
* sysdeps/unix/sysv/linux/sh/pwrite.c (__libc_pwrite): Likewise.
* sysdeps/unix/sysv/linux/sh/pwrite64.c (__libc_pwrite64): Likewise.
* sysdeps/unix/sysv/linux/sigsuspend.c (__sigsuspend): Likewise.
* sysdeps/unix/sysv/linux/sigtimedwait.c (__sigtimedwait): Likewise.
* sysdeps/unix/sysv/linux/sigwaitinfo.c (__sigwaitinfo): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c (__libc_msgrcv):
Likewise.
* sysdeps/unix/sysv/linux/sync_file_range.c (sync_file_range):
Likewise.
* sysdeps/unix/sysv/linux/tcdrain.c (__libc_tcdrain): Likewise.
* sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
Likewise.
* sysdeps/unix/sysv/linux/wait.c (__libc_wait): Likewise.
* sysdeps/unix/sysv/linux/waitid.c (__waitid): Likewise.
* sysdeps/unix/sysv/linux/waitpid.c (__libc_waitpid): Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/fallocate.c (fallocate):
Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/preadv.c (preadv): Likewise.
* sysdeps/unix/sysv/linux/wordsize-64/pwritev.c (pwritev): Likewise.
* sysdeps/unix/sysv/linux/writev.c (__libc_writev): Likewise.
* sysdeps/unix/sysv/linux/x86_64/recv.c (__libc_recv): Likewise.
* sysdeps/unix/sysv/linux/x86_64/send.c (__libc_send): Likewise.

74 files changed:
ChangeLog
sysdeps/unix/sysdep.h
sysdeps/unix/sysv/linux/accept4.c
sysdeps/unix/sysv/linux/alpha/fdatasync.c
sysdeps/unix/sysv/linux/arm/pread.c
sysdeps/unix/sysv/linux/arm/pread64.c
sysdeps/unix/sysv/linux/arm/pwrite.c
sysdeps/unix/sysv/linux/arm/pwrite64.c
sysdeps/unix/sysv/linux/epoll_pwait.c
sysdeps/unix/sysv/linux/fallocate.c
sysdeps/unix/sysv/linux/fallocate64.c
sysdeps/unix/sysv/linux/generic/open.c
sysdeps/unix/sysv/linux/generic/open64.c
sysdeps/unix/sysv/linux/generic/pause.c
sysdeps/unix/sysv/linux/generic/poll.c
sysdeps/unix/sysv/linux/generic/recv.c
sysdeps/unix/sysv/linux/generic/select.c
sysdeps/unix/sysv/linux/generic/send.c
sysdeps/unix/sysv/linux/generic/sysdep.h
sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c
sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c
sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c
sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c
sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c
sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c
sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c
sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev64.c
sysdeps/unix/sysv/linux/i386/fcntl.c
sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c
sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c
sysdeps/unix/sysv/linux/mips/pread.c
sysdeps/unix/sysv/linux/mips/pread64.c
sysdeps/unix/sysv/linux/mips/pwrite.c
sysdeps/unix/sysv/linux/mips/pwrite64.c
sysdeps/unix/sysv/linux/msgrcv.c
sysdeps/unix/sysv/linux/msgsnd.c
sysdeps/unix/sysv/linux/open64.c
sysdeps/unix/sysv/linux/openat.c
sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c
sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c
sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c
sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c
sysdeps/unix/sysv/linux/powerpc/powerpc64/sync_file_range.c
sysdeps/unix/sysv/linux/ppoll.c
sysdeps/unix/sysv/linux/pread.c
sysdeps/unix/sysv/linux/pread64.c
sysdeps/unix/sysv/linux/preadv.c
sysdeps/unix/sysv/linux/pselect.c
sysdeps/unix/sysv/linux/pwrite.c
sysdeps/unix/sysv/linux/pwrite64.c
sysdeps/unix/sysv/linux/pwritev.c
sysdeps/unix/sysv/linux/recvmmsg.c
sysdeps/unix/sysv/linux/sendmmsg.c
sysdeps/unix/sysv/linux/sh/pread.c
sysdeps/unix/sysv/linux/sh/pread64.c
sysdeps/unix/sysv/linux/sh/pwrite.c
sysdeps/unix/sysv/linux/sh/pwrite64.c
sysdeps/unix/sysv/linux/sigsuspend.c
sysdeps/unix/sysv/linux/sigtimedwait.c
sysdeps/unix/sysv/linux/sigwaitinfo.c
sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c
sysdeps/unix/sysv/linux/sync_file_range.c
sysdeps/unix/sysv/linux/tcdrain.c
sysdeps/unix/sysv/linux/timer_routines.c
sysdeps/unix/sysv/linux/wait.c
sysdeps/unix/sysv/linux/waitid.c
sysdeps/unix/sysv/linux/waitpid.c
sysdeps/unix/sysv/linux/wordsize-64/fallocate.c
sysdeps/unix/sysv/linux/wordsize-64/preadv.c
sysdeps/unix/sysv/linux/wordsize-64/pwritev.c
sysdeps/unix/sysv/linux/x86_64/recv.c
sysdeps/unix/sysv/linux/x86_64/send.c

index 0d807909c6a2c48cf6ef62fa3a38032130802d6a..b81b83a024997455673742bb777593d1f848573b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,114 @@
+2015-06-04  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
+
+       * sysdeps/unix/sysdep.h [SYSCALL_CANCEL]: New macro: define
+       cancellable syscalls.
+       (SYS_ify): Add guard to no redefine it.
+       (INLINE_SYSCALL): Likewise.
+       * sysdeps/unix/sysv/linux/accept4.c (accept4): Remove
+       LIBC_CANCEL_ASYNC/INLINE_SYSCALL/LIBC_CANCEL_RESET and use
+       SYSCALL_CANCEL instead.
+       * sysdeps/unix/sysv/linux/alpha/fdatasync.c (__fdatasync): Likewise.
+       * sysdeps/unix/sysv/linux/arm/pread.c (__libc_pread): Likewise.
+       * sysdeps/unix/sysv/linux/arm/pread64.c (__libc_pread64): Likewise.
+       * sysdeps/unix/sysv/linux/arm/pwrite.c (__libc_pwrite): Likewise.
+       * sysdeps/unix/sysv/linux/arm/pwrite64.c (__libc_pwrite64): Likewise.
+       * sysdeps/unix/sysv/linux/epoll_pwait.c (epoll_pwait): Likewise.
+       * sysdeps/unix/sysv/linux/fallocate.c (fallocate): Likewise.
+       * sysdeps/unix/sysv/linux/fallocate64.c (fallocate64): Likewise.
+       * sysdeps/unix/sysv/linux/generic/open.c (__libc_open): Likewise.
+       * sysdeps/unix/sysv/linux/generic/open64.c (__libc_open64): Likewise.
+       * sysdeps/unix/sysv/linux/generic/pause.c (__libc_pause): Likewise.
+       * sysdeps/unix/sysv/linux/generic/poll.c (__poll): Likewise.
+       * sysdeps/unix/sysv/linux/generic/recv.c (__libc_recv): Likewise.
+       * sysdeps/unix/sysv/linux/generic/select.c (__select): Likewise.
+       * sysdeps/unix/sysv/linux/generic/send.c (__libc_send): Likewise.
+       * sysdeps/unix/sysv/linux/generic/wordsize-32/pread.c (__libc_pread):
+       Likewise.
+       * sysdeps/unix/sysv/linux/generic/wordsize-32/pread64.c
+       (__libc_pread64): Likewise.
+       * sysdeps/unix/sysv/linux/generic/wordsize-32/preadv.c
+       (__libc_preadv): Likewise.
+       * sysdeps/unix/sysv/linux/generic/wordsize-32/preadv64.c
+       (__libc_readv64): Likewise.
+       * sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite.c
+       (__libc_pwrite): Likewise.
+       * sysdeps/unix/sysv/linux/generic/wordsize-32/pwrite64.c
+       (__libc_pwrite64): Likewise.
+       * sysdeps/unix/sysv/linux/generic/wordsize-32/pwritev.c
+       (__libc_pwritev): Likewise.
+       * sysdeps/sysv/linux/generic/wordsize-32/pwritev64.c
+       (__libc_pwritev64): Likewise.
+       * sysdeps/unix/sysv/linux/i386/fcntl.c (__libc_fcntl): Likewise.
+       * sysdeps/unix/sysv/linux/mips/mips32/sync_file_range.c
+       (sync_file_range): Likewise.
+       * sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate.c (fallocate):
+       Likewise.
+       * sysdeps/unix/sysv/linux/mips/mips64/n32/fallocate64.c (fallocate64):
+       Likewise.
+       * sysdeps/unix/sysv/linux/mips/pread.c (__libc_pread): Likewise.
+       * sysdeps/unix/sysv/linux/mips/pread64.c (__libc_pread64): Likewise.
+       * sysdeps/unix/sysv/linux/mips/pwrite.c (__libc_pwrite): Likewise.
+       * sysdeps/unix/sysv/linux/mips/pwrite64.c (__libc_pwrite64): Likewise.
+       * sysdeps/unix/sysv/linux/msgrcv.c (__libc_msgrcv): Likewise.
+       * sysdeps/unix/sysv/linux/msgsnd.c (__libc_msgsnd): Likewise.
+       * sysdeps/unix/sysv/linux/open64.c (__libc_open64): Likewise.
+       * sysdeps/unix/sysv/linux/openat.c (__libc_openat): Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/pread.c (__libc_pread):
+       Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/pread64.c
+       (__libc_read64): Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite.c (__libc_write):
+       Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc32/pwrite64.c (__libc_write64):
+       Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/fcntl.c (__libc_fcntl):
+       Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/pread.c (__libc_pread):
+       Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/pread64.c
+       (__libc_pread64): Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite.c (__libc_pwrite):
+       Likewise.
+       * sysdeps/unix/sysv/linux/powerpc/powerpc64/pwrite64.c
+       (__libc_pwrite64): Likewise.
+       * sysdeps/sysv/linux/powerpc/powerpc64/sync_file_range.c
+       (sync_file_range): Likewise.
+       * sysdeps/unix/sysv/linux/ppoll.c (ppoll): Likewise.
+       * sysdeps/unix/sysv/linux/pread.c (__libc_pread): Likewise.
+       * sysdeps/unix/sysv/linux/pread64.c (__libc_pread64): Likewise.
+       * sysdeps/unix/sysv/linux/preadv.c (__libc_preadv): Likewise.
+       * sysdeps/unix/sysv/linux/pselect.c (__pselect): Likewise.
+       * sysdeps/unix/sysv/linux/pwrite.c (__libc_pwrite): Likewise.
+       * sysdeps/unix/sysv/linux/pwrite64.c (__libc_pwrite64): Likewise.
+       * sysdeps/unix/sysv/linux/pwritev.c (PWRITEV): Likewise.
+       * sysdeps/unix/sysv/linux/readv.c (__libc_readv): Likewise.
+       * sysdeps/unix/sysv/linux/recvmmsg.c (recvmmsg): Likewise.
+       * sysdeps/unix/sysv/linux/sendmmsg.c (sendmmsg): Likewise.
+       * sysdeps/unix/sysv/linux/sh/pread.c (__libc_pread): Likewise.
+       * sysdeps/unix/sysv/linux/sh/pread64.c (__libc_pread64): Likewise.
+       * sysdeps/unix/sysv/linux/sh/pwrite.c (__libc_pwrite): Likewise.
+       * sysdeps/unix/sysv/linux/sh/pwrite64.c (__libc_pwrite64): Likewise.
+       * sysdeps/unix/sysv/linux/sigsuspend.c (__sigsuspend): Likewise.
+       * sysdeps/unix/sysv/linux/sigtimedwait.c (__sigtimedwait): Likewise.
+       * sysdeps/unix/sysv/linux/sigwaitinfo.c (__sigwaitinfo): Likewise.
+       * sysdeps/unix/sysv/linux/sparc/sparc64/msgrcv.c (__libc_msgrcv):
+       Likewise.
+       * sysdeps/unix/sysv/linux/sync_file_range.c (sync_file_range):
+       Likewise.
+       * sysdeps/unix/sysv/linux/tcdrain.c (__libc_tcdrain): Likewise.
+       * sysdeps/unix/sysv/linux/timer_routines.c (timer_helper_thread):
+       Likewise.
+       * sysdeps/unix/sysv/linux/wait.c (__libc_wait): Likewise.
+       * sysdeps/unix/sysv/linux/waitid.c (__waitid): Likewise.
+       * sysdeps/unix/sysv/linux/waitpid.c (__libc_waitpid): Likewise.
+       * sysdeps/unix/sysv/linux/wordsize-64/fallocate.c (fallocate):
+       Likewise.
+       * sysdeps/unix/sysv/linux/wordsize-64/preadv.c (preadv): Likewise.
+       * sysdeps/unix/sysv/linux/wordsize-64/pwritev.c (pwritev): Likewise.
+       * sysdeps/unix/sysv/linux/writev.c (__libc_writev): Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/recv.c (__libc_recv): Likewise.
+       * sysdeps/unix/sysv/linux/x86_64/send.c (__libc_send): Likewise.
+
 2015-06-04  Nathan Lynch  <nathan_lynch@codesourcery.com>
 
        * sysdeps/unix/sysv/linux/arm/Makefile: (sysdep_routines):
index 5fa658078ec5862a38553ff300661ad5773ba1ef..52dad582ce406af4dd728b75a9ac90baa8fdfa9d 100644 (file)
 #define        SYSCALL__(name, args)   PSEUDO (__##name, name, args)
 #define        SYSCALL(name, args)     PSEUDO (name, name, args)
 
+/* Cancellation macros.  */
+#define __SYSCALL_NARGS_X(a,b,c,d,e,f,g,n,...) n
+#define __SYSCALL_NARGS(...) \
+  __SYSCALL_NARGS_X (__VA_ARGS__, 7, 6, 5, 4, 3, 2, 1, 0,)
+
+#define SYSCALL_CANCEL(name, ...) \
+  ({                                                                        \
+    long int sc_ret;                                                        \
+    if (SINGLE_THREAD_P)                                                    \
+      sc_ret = INLINE_SYSCALL (name, __SYSCALL_NARGS(__VA_ARGS__),          \
+                              __VA_ARGS__);                                 \
+    else                                                                    \
+      {                                                                             \
+       int sc_cancel_oldtype = LIBC_CANCEL_ASYNC ();                        \
+       sc_ret = INLINE_SYSCALL (name, __SYSCALL_NARGS (__VA_ARGS__),        \
+                                __VA_ARGS__);                               \
+        LIBC_CANCEL_RESET (sc_cancel_oldtype);                              \
+      }                                                                             \
+    sc_ret;                                                                 \
+  })
+
 /* Machine-dependent sysdep.h files are expected to define the macro
    PSEUDO (function_name, syscall_name) to emit assembly code to define the
    C-callable function FUNCTION_NAME to do system call SYSCALL_NAME.
@@ -31,7 +52,9 @@
    an instruction such that "MOVE(r1, r0)" works.  ret should be defined
    as the return instruction.  */
 
+#ifndef SYS_ify
 #define SYS_ify(syscall_name) SYS_##syscall_name
+#endif
 
 /* Terminate a system call named SYM.  This is used on some platforms
    to generate correct debugging information.  */
@@ -47,4 +70,6 @@
 
 /* Wrappers around system calls should normally inline the system call code.
    But sometimes it is not possible or implemented and we use this code.  */
+#ifndef INLINE_SYSCALL
 #define INLINE_SYSCALL(name, nr, args...) __syscall_##name (args)
+#endif
index ec6b4c236dfbc44d311a89369cb8be49c8edfdba..6f59bfabc8d95f63c6992584f9e51159528c0b0c 100644 (file)
 int
 accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (accept4, 4, fd, addr.__sockaddr__, addr_len, flags);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (accept4, 4, fd, addr.__sockaddr__, addr_len,
-                              flags);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (accept4, fd, addr.__sockaddr__, addr_len, flags);
 }
 #elif defined __NR_socketcall
 # include <socketcall.h>
index c9424e267f679728d0d0d798578ba8c2b598c736..c8b711ebe978d26149256f736202e0733357556f 100644 (file)
 
 #include <kernel-features.h>
 
-static int
-do_fdatasync (int fd)
+int
+__fdatasync (int fd)
 {
 #ifdef __ASSUME_FDATASYNC
-  return INLINE_SYSCALL (fdatasync, 1, fd);
+  return SYSCALL_CANCEL (fdatasync, fd);
 #elif defined __NR_fdatasync
   static int __have_no_fdatasync;
 
   if (!__builtin_expect (__have_no_fdatasync, 0))
     {
-      int result = INLINE_SYSCALL (fdatasync, 1, fd);
+      int result = SYSCALL_CANCEL (fdatasync, fd);
       if (__builtin_expect (result, 0) != -1 || errno != ENOSYS)
        return result;
 
       __have_no_fdatasync = 1;
     }
 #endif
-  return INLINE_SYSCALL (fsync, 1, fd);
-}
-
-int
-__fdatasync (int fd)
-{
-  if (SINGLE_THREAD_P)
-    return do_fdatasync (fd);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = do_fdatasync (fd);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (fsync, fd);
 }
-
 weak_alias (__fdatasync, fdatasync)
index 64bc0a101500a6b6f9a5a80275927c9792999724..91b3c66739477c9d0c43421f8d63546c08c744bb 100644 (file)
 ssize_t
 __libc_pread (int fd, void *buf, size_t count, off_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
-      /* In the ARM EABI, 64-bit values are aligned to even/odd register
-        pairs for syscalls.  */
-      result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
-                              __LONG_LONG_PAIR (offset >> 31, offset));
-
-      return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
   /* In the ARM EABI, 64-bit values are aligned to even/odd register
      pairs for syscalls.  */
-  result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
-                          __LONG_LONG_PAIR (offset >> 31, offset));
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pread64, fd, buf, count, 0,
+                        __LONG_LONG_PAIR (offset >> 31, offset));
 }
 
 strong_alias (__libc_pread, __pread)
index 78606997f9af9f6b23c41c8a5df631f4f29f7aad..ca71feb17bdda12a63cafce2c3b888460d74a117 100644 (file)
 ssize_t
 __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
-      /* In the ARM EABI, 64-bit values are aligned to even/odd register
-        pairs for syscalls.  */
-      result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
-                              __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                                (off_t) (offset & 0xffffffff)));
-
-      return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
   /* In the ARM EABI, 64-bit values are aligned to even/odd register
      pairs for syscalls.  */
-  result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0,
-                          __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                            (off_t) (offset & 0xffffffff)));
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pread64, fd, buf, count, 0,
+                        __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                          (off_t) (offset & 0xffffffff)));
 }
 
 weak_alias (__libc_pread64, __pread64)
index 11a963ca6cd940b1d1b4577ba83d3f763e8ae79e..e22e112356ce30836ae87bf7d9702191b17d171f 100644 (file)
 ssize_t
 __libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
-      /* In the ARM EABI, 64-bit values are aligned to even/odd register
-        pairs for syscalls.  */
-      result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
-                              __LONG_LONG_PAIR (offset >> 31, offset));
-
-      return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
   /* In the ARM EABI, 64-bit values are aligned to even/odd register
      pairs for syscalls.  */
-  result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
-                          __LONG_LONG_PAIR (offset >> 31, offset));
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pwrite64, fd, buf, count, 0,
+                        __LONG_LONG_PAIR (offset >> 31, offset));
 }
 
 strong_alias (__libc_pwrite, __pwrite)
index 9cb67ff006f06fde37da4970d0946979807f7cdc..b63fbc86213c87a68b06ebc22d8b7140ce84040a 100644 (file)
 ssize_t
 __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
-      /* In the ARM EABI, 64-bit values are aligned to even/odd register
-        pairs for syscalls.  */
-      result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
-                              __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                                (off_t) (offset & 0xffffffff)));
-
-      return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
   /* In the ARM EABI, 64-bit values are aligned to even/odd register
      pairs for syscalls.  */
-  result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0,
-                          __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                            (off_t) (offset & 0xffffffff)));
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pwrite64, fd, buf, count, 0,
+                        __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                          (off_t) (offset & 0xffffffff)));
 }
 
 weak_alias (__libc_pwrite64, __pwrite64)
index 65fefec0bcd2508ac4b23595dcc02e6b6224b0c2..0e390130798e01002abbc8f13cf4b0f490b7e0cf 100644 (file)
@@ -39,18 +39,8 @@ int epoll_pwait (int epfd, struct epoll_event *events,
                 int maxevents, int timeout,
                 const sigset_t *set)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (epoll_pwait, 6, epfd, events, maxevents, timeout,
-                          set, _NSIG / 8);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (epoll_pwait, 6, epfd, events, maxevents,
-                              timeout, set, _NSIG / 8);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (epoll_pwait, epfd, events, maxevents,
+                        timeout, set, _NSIG / 8);
 }
 
 #else
index e9668bfb679528d891e7f089add453d373d12425..f3de90c3479d7123272c12006ef6de6e014ba594 100644 (file)
@@ -25,21 +25,9 @@ int
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (fallocate, 6, fd, mode,
-                          __LONG_LONG_PAIR (offset >> 31, offset),
-                          __LONG_LONG_PAIR (len >> 31, len));
-
-  int result;
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (fallocate, 6, fd, mode,
-                          __LONG_LONG_PAIR (offset >> 31, offset),
-                          __LONG_LONG_PAIR (len >> 31, len));
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (fallocate, fd, mode,
+                        __LONG_LONG_PAIR (offset >> 31, offset),
+                        __LONG_LONG_PAIR (len >> 31, len));
 #else
   __set_errno (ENOSYS);
   return -1;
index 96acb2801e4994ab1c6e3ba302320cb2c5002c03..191fa575be8effd30f0847ece130d8687fe38714 100644 (file)
@@ -25,25 +25,11 @@ int
 fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
 {
 #ifdef __NR_fallocate
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (fallocate, 6, fd, mode,
-                          __LONG_LONG_PAIR ((long int) (offset >> 32),
-                                            (long int) offset),
-                          __LONG_LONG_PAIR ((long int) (len >> 32),
-                                            (long int) len));
-
-  int result;
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (fallocate, 6, fd, mode,
-                          __LONG_LONG_PAIR ((long int) (offset >> 32),
-                                            (long int) offset),
-                          __LONG_LONG_PAIR ((long int) (len >> 32),
-                                            (long int) len));
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (fallocate, fd, mode,
+                        __LONG_LONG_PAIR ((long int) (offset >> 32),
+                                          (long int) offset),
+                        __LONG_LONG_PAIR ((long int) (len >> 32),
+                                          (long int) len));
 #else
   __set_errno (ENOSYS);
   return -1;
index 289f57aadafb76f5b04009fb01c03e037c83bd51..66cc2edf4b22cd42d8032ef91ef30440da6738ae 100644 (file)
@@ -37,16 +37,7 @@ __libc_open (const char *file, int oflag, ...)
       va_end (arg);
     }
 
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (openat, 4, AT_FDCWD, file, oflag, mode);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (openat, 4, AT_FDCWD, file, oflag, mode);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (openat, AT_FDCWD, file, oflag, mode);
 }
 libc_hidden_def (__libc_open)
 
index 374e41cf3a02f848237e3c0f719a2d7382ec5ff9..402bc7cd7fb6c224597269e96d0a5f439fb0a784 100644 (file)
@@ -37,18 +37,7 @@ __libc_open64 (const char *file, int oflag, ...)
       va_end (arg);
     }
 
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (openat, 4, AT_FDCWD, file,
-                           oflag | O_LARGEFILE, mode);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (openat, 4, AT_FDCWD, file,
-                               oflag | O_LARGEFILE, mode);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (openat, AT_FDCWD, file, oflag | O_LARGEFILE, mode);
 }
 weak_alias (__libc_open64, __open64)
 libc_hidden_weak (__open64)
index 7966df2499cf2599ff6812d90a78d80158d624d5..45d3a0eb2132548df85f11de72f2f13e913d486c 100644 (file)
 /* Suspend the process until a signal arrives.
    This always returns -1 and sets errno to EINTR.  */
 
-static int
-__syscall_pause (void)
+int
+__libc_pause (void)
 {
   sigset_t set;
 
   int rc =
-    INLINE_SYSCALL (rt_sigprocmask, 4, SIG_BLOCK, NULL, &set, _NSIG / 8);
+    SYSCALL_CANCEL (rt_sigprocmask, SIG_BLOCK, NULL, &set, _NSIG / 8);
   if (rc == 0)
-    rc = INLINE_SYSCALL (rt_sigsuspend, 2, &set, _NSIG / 8);
+    rc = SYSCALL_CANCEL (rt_sigsuspend, &set, _NSIG / 8);
 
   return rc;
 }
 
-int
-__libc_pause (void)
-{
-  if (SINGLE_THREAD_P)
-    return __syscall_pause ();
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = __syscall_pause ();
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-}
 weak_alias (__libc_pause, pause)
-
-#ifndef NO_CANCELLATION
-# include <not-cancel.h>
-
-int
-__pause_nocancel (void)
-{
-  return __syscall_pause ();
-}
-#endif
index 7ef42f37ea5a1bf3df085ad344aff5ef6420db43..2a95796d68dde4e864bb74cc6f7f4a7a96db27f7 100644 (file)
@@ -35,16 +35,7 @@ __poll (struct pollfd *fds, nfds_t nfds, int timeout)
       timeout_ts_p = &timeout_ts;
     }
 
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (ppoll, 5, fds, nfds, timeout_ts_p, NULL, 0);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (ppoll, 5, fds, nfds, timeout_ts_p, NULL, 0);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (ppoll, fds, nfds, timeout_ts_p, NULL, 0);
 }
 libc_hidden_def (__poll)
 weak_alias (__poll, poll)
index d827b3ea21dd8e33ad745a3c60234bf4c41b9436..37861721e7f1de5913da1de60d040d2b80a4ec92 100644 (file)
 ssize_t
 __libc_recv (int sockfd, void *buffer, size_t len, int flags)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    result = INLINE_SYSCALL (recvfrom, 6, sockfd, buffer, len, flags,
-                             NULL, NULL);
-  else
-    {
-      int oldtype = LIBC_CANCEL_ASYNC ();
-
-      result = INLINE_SYSCALL (recvfrom, 6, sockfd, buffer, len, flags,
-                               NULL, NULL);
-
-      LIBC_CANCEL_RESET (oldtype);
-    }
-
-  return result;
+  return SYSCALL_CANCEL (recvfrom, sockfd, buffer, len, flags,
+                        NULL, NULL);
 }
 strong_alias (__libc_recv, __recv)
 weak_alias (__libc_recv, recv)
index 455c308f1317327a7a27381045af3e56a378f2c5..f7f1e18d4d9904b991f54be9bcd8831700e300f3 100644 (file)
@@ -42,20 +42,8 @@ __select(int nfds, fd_set *readfds,
       tsp = &ts;
     }
 
-  if (SINGLE_THREAD_P)
-    {
-      result = INLINE_SYSCALL (pselect6, 6, nfds, readfds, writefds, exceptfds,
-                               tsp, NULL);
-    }
-  else
-    {
-      int oldtype = LIBC_CANCEL_ASYNC ();
-
-      result = INLINE_SYSCALL (pselect6, 6, nfds, readfds, writefds, exceptfds,
-                               tsp, NULL);
-
-      LIBC_CANCEL_RESET (oldtype);
-    }
+  result = SYSCALL_CANCEL (pselect6, nfds, readfds, writefds, exceptfds, tsp,
+                          NULL);
 
   if (timeout)
     {
index dfbdc091ff5eb1b3a7fc1c6de32f4b7d8b3d2fe2..fed69613e186411da69a8433dd1b182797578041 100644 (file)
 ssize_t
 __libc_send (int sockfd, const void *buffer, size_t len, int flags)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    result = INLINE_SYSCALL (sendto, 6, sockfd, buffer, len, flags, NULL, 0);
-  else
-    {
-      int oldtype = LIBC_CANCEL_ASYNC ();
-
-      result = INLINE_SYSCALL (sendto, 6, sockfd, buffer, len, flags, NULL, 0);
-
-      LIBC_CANCEL_RESET (oldtype);
-    }
-
-  return result;
+  return SYSCALL_CANCEL (sendto, sockfd, buffer, len, flags, NULL, 0);
 }
 strong_alias (__libc_send, __send)
 weak_alias (__libc_send, send)
index 160804cd9ecfffdd8dba58b16658f08b08ddfb9b..11da9d21df6e04fa0bf21caab5220ed1b30fb22d 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <bits/wordsize.h>
 #include <kernel-features.h>
+#include <sysdeps/unix/sysdep.h>
 
 /* Provide the common name to allow more code reuse.  */
 #define __NR__llseek __NR_llseek
index ad97e97135021f8313be0da15f753c6c4042da35..6f9703cc21420e5679d9f5e81f72854eb4ab7621 100644 (file)
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
-static ssize_t
-do_pread (int fd, void *buf, size_t count, off_t offset)
+ssize_t
+__libc_pread (int fd, void *buf, size_t count, off_t offset)
 {
   assert (sizeof (offset) == 4);
-  return INLINE_SYSCALL (pread64, __ALIGNMENT_COUNT (5, 6), fd,
+  return SYSCALL_CANCEL (pread64, fd,
                          buf, count, __ALIGNMENT_ARG
                          __LONG_LONG_PAIR (offset >> 31, offset));
 }
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t count, off_t offset)
-{
-  if (SINGLE_THREAD_P)
-    return do_pread (fd, buf, count, offset);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = do_pread (fd, buf, count, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-}
 strong_alias (__libc_pread, __pread)
 weak_alias (__libc_pread, pread)
index 7250893297b81c63274a931668d3d47c3a924216..a3f8ec1caacffc767b2563dabb33029334d0ac17 100644 (file)
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
-static ssize_t
-do_pread64 (int fd, void *buf, size_t count, off64_t offset)
-{
-  return INLINE_SYSCALL (pread64, __ALIGNMENT_COUNT (5, 6), fd,
-                         buf, count, __ALIGNMENT_ARG
-                         __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                           (off_t) (offset & 0xffffffff)));
-}
-
-
 ssize_t
 __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
 {
-  if (SINGLE_THREAD_P)
-    return do_pread64 (fd, buf, count, offset);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = do_pread64 (fd, buf, count, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pread64, fd, buf, count, __ALIGNMENT_ARG
+                         __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                           (off_t) (offset & 0xffffffff)));
 }
-
 weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, pread64)
index 9a1832a854afdcd003a16eb7f44cf9ff45a6a6f1..d127fee927b854aa64cd96037b7101868586b4b4 100644 (file)
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
-static ssize_t
-do_preadv (int fd, const struct iovec *vector, int count, off_t offset)
+ssize_t
+__libc_preadv (int fd, const struct iovec *vector, int count, off_t offset)
 {
   assert (sizeof (offset) == 4);
-  return INLINE_SYSCALL (preadv, __ALIGNMENT_COUNT (5, 6), fd,
+  return SYSCALL_CANCEL (preadv, fd,
                          vector, count, __ALIGNMENT_ARG
                          __LONG_LONG_PAIR (offset >> 31, offset));
 }
-
-ssize_t
-__libc_preadv (int fd, const struct iovec *vector, int count, off_t offset)
-{
-  if (SINGLE_THREAD_P)
-    return do_preadv (fd, vector, count, offset);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = do_preadv (fd, vector, count, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-}
 strong_alias (__libc_preadv, __preadv)
 weak_alias (__libc_preadv, preadv)
index df1c010a70d1b970e707e24c1ef55d2153e6b004..7e7ebf740f8a284bb838aa28616740e5276da816 100644 (file)
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
-static ssize_t
-do_preadv64 (int fd, const struct iovec *vector, int count, off64_t offset)
+ssize_t
+__libc_preadv64 (int fd, const struct iovec *vector, int count, off64_t offset)
 {
-  return INLINE_SYSCALL (preadv, __ALIGNMENT_COUNT (5, 6), fd,
+  return SYSCALL_CANCEL (preadv, fd,
                          vector, count, __ALIGNMENT_ARG
                          __LONG_LONG_PAIR ((off_t) (offset >> 32),
                                            (off_t) (offset & 0xffffffff)));
 }
 
-
-ssize_t
-__libc_preadv64 (int fd, const struct iovec *vector, int count, off64_t offset)
-{
-  if (SINGLE_THREAD_P)
-    return do_preadv64 (fd, vector, count, offset);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = do_preadv64 (fd, vector, count, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-}
-
 strong_alias (__libc_preadv64, __preadv64)
 weak_alias (__libc_preadv64, preadv64)
index e897c7d6ad1a94b8eb29b0729abf1abade0f4c5c..2f0f7a174779df6819625e17e28c8335b995b039 100644 (file)
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
-static ssize_t
-do_pwrite (int fd, const void *buf, size_t count, off_t offset)
-{
-  assert (sizeof (offset) == 4);
-  return INLINE_SYSCALL (pwrite64, __ALIGNMENT_COUNT (5, 6), fd,
-                         buf, count, __ALIGNMENT_ARG
-                         __LONG_LONG_PAIR (offset >> 31, offset));
-}
-
-
 ssize_t
 __libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
 {
-  if (SINGLE_THREAD_P)
-    return do_pwrite (fd, buf, count, offset);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = do_pwrite (fd, buf, count, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  assert (sizeof (offset) == 4);
+  return SYSCALL_CANCEL (pwrite64, fd, buf, count, __ALIGNMENT_ARG
+                         __LONG_LONG_PAIR (offset >> 31, offset));
 }
 strong_alias (__libc_pwrite, __pwrite)
 weak_alias (__libc_pwrite, pwrite)
index 3ac1339b9a321d713673a5b64171b3532383a164..f222016e0f7051605c1709e671ecd329a31a0992 100644 (file)
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
-static ssize_t
-do_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
-{
-  return INLINE_SYSCALL (pwrite64, __ALIGNMENT_COUNT (5, 6), fd,
-                         buf, count, __ALIGNMENT_ARG
-                         __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                           (off_t) (offset & 0xffffffff)));
-}
-
-
 ssize_t
 __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
 {
-  if (SINGLE_THREAD_P)
-    return do_pwrite64 (fd, buf, count, offset);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = do_pwrite64 (fd, buf, count, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pwrite64, fd, buf, count, __ALIGNMENT_ARG
+                         __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                           (off_t) (offset & 0xffffffff)));
 }
-
 weak_alias (__libc_pwrite64, __pwrite64)
 libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64)
index db1e4cb5d2352f2de63cd21bebc712c48b65cbb1..273b0ffb4744e4b47294e838df3855f798b84e58 100644 (file)
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
-static ssize_t
-do_pwritev (int fd, const struct iovec *vector, int count, off_t offset)
-{
-  assert (sizeof (offset) == 4);
-  return INLINE_SYSCALL (pwritev, __ALIGNMENT_COUNT (5, 6), fd,
-                         vector, count, __ALIGNMENT_ARG
-                         __LONG_LONG_PAIR (offset >> 31, offset));
-}
-
-
 ssize_t
 __libc_pwritev (int fd, const struct iovec *vector, int count, off_t offset)
 {
-  if (SINGLE_THREAD_P)
-    return do_pwritev (fd, vector, count, offset);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = do_pwritev (fd, vector, count, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  assert (sizeof (offset) == 4);
+  return SYSCALL_CANCEL (pwritev, fd, vector, count, __ALIGNMENT_ARG
+                         __LONG_LONG_PAIR (offset >> 31, offset));
 }
 strong_alias (__libc_pwritev, __pwritev)
 weak_alias (__libc_pwritev, pwritev)
index eb85e079d756f3026661068809094f417c2cf758..9d3fa75c7a9b5b75834a3cc3a9a5d900ea8db523 100644 (file)
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
-static ssize_t
-do_pwritev64 (int fd, const struct iovec *vector, int count, off64_t offset)
-{
-  return INLINE_SYSCALL (pwritev, __ALIGNMENT_COUNT (5, 6), fd,
-                         vector, count, __ALIGNMENT_ARG
-                         __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                           (off_t) (offset & 0xffffffff)));
-}
-
-
 ssize_t
 __libc_pwritev64 (int fd, const struct iovec *vector, int count,
                   off64_t offset)
 {
-  if (SINGLE_THREAD_P)
-    return do_pwritev64 (fd, vector, count, offset);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = do_pwritev64 (fd, vector, count, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pwritev, fd,
+                         vector, count, __ALIGNMENT_ARG
+                         __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                           (off_t) (offset & 0xffffffff)));
 }
-
 strong_alias (__libc_pwritev64, pwritev64)
 weak_alias (__libc_pwritev64, __pwritev64)
index 9132c5a9d721177c0a182165d44f0c6be3716582..56f4bd17784dfbd58aed182f98f83e4437949615 100644 (file)
@@ -49,16 +49,10 @@ __libc_fcntl (int fd, int cmd, ...)
   arg = va_arg (ap, void *);
   va_end (ap);
 
-  if (SINGLE_THREAD_P || (cmd != F_SETLKW && cmd != F_SETLKW64))
+  if ((cmd != F_SETLKW) && (cmd != F_SETLKW64))
     return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
 
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (fcntl64, fd, cmd, arg);
 }
 libc_hidden_def (__libc_fcntl)
 
index 3c91d15e671c83babb96a8e058eebb222775500f..b79e44d0eb619622eb8129e2b4befbec694e844a 100644 (file)
 int
 sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (sync_file_range, 7, fd, 0,
-                          __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
-                          __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
-                          flags);
-
-  int result;
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (sync_file_range, 7, fd, 0,
-                          __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
-                          __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
-                          flags);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (sync_file_range, fd, 0,
+                        __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+                        __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+                        flags);
 }
 #else
 int
index 2331cec93bd94f0b51c5a30c9f7d0d8fa2b4c11b..ce29a0ec7167720603e9f31bdc8b43737ea9fb2d 100644 (file)
@@ -25,17 +25,7 @@ int
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
-
-  int result;
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (fallocate, fd, mode, offset, len);
 #else
   __set_errno (ENOSYS);
   return -1;
index d3ed5d19ff55834a07b5434d98fc7a164a656038..077127eee822dc4998053c7666d6a5622bed9327 100644 (file)
@@ -25,17 +25,7 @@ int
 fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
 {
 #ifdef __NR_fallocate
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
-
-  int result;
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (fallocate, fd, mode, offset, len);
 #else
   __set_errno (ENOSYS);
   return -1;
index a7b16189681d4c01e5b14208885d45c58aff859e..0bd712dcd56ba5e61391c2bcaaaf905147246e05 100644 (file)
 ssize_t
 __libc_pread (int fd, void *buf, size_t count, off_t offset)
 {
-  ssize_t result;
-
 #if _MIPS_SIM != _ABI64
   assert (sizeof (offset) == 4);
 #endif
 
-  if (SINGLE_THREAD_P)
-    {
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-      result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
-#else
-      result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
-                              __LONG_LONG_PAIR (offset >> 31, offset));
-#endif
-      return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
 #if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-  result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
+  return SYSCALL_CANCEL (pread, fd, buf, count, offset);
 #else
-  result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
-                          __LONG_LONG_PAIR (offset >> 31, offset));
+  return SYSCALL_CANCEL (pread, fd, buf, count, 0,
+                        __LONG_LONG_PAIR (offset >> 31, offset));
 #endif
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
 }
 
 strong_alias (__libc_pread, __pread)
index ad948aada7681bc5ab4cf308e61f04e6dc8ab32a..3ed100be02c615772d9aa812c6c7eeef9b7fc77b 100644 (file)
 ssize_t
 __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
 {
-  ssize_t result;
-
-
-  if (SINGLE_THREAD_P)
-    {
 #if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-      result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
+  return SYSCALL_CANCEL (pread, fd, buf, count, offset);
 #else
-     result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
-                             __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                             (off_t) (offset & 0xffffffff)));
+  return SYSCALL_CANCEL (pread, fd, buf, count, 0,
+                        __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                          (off_t) (offset & 0xffffffff)));
 #endif
-     return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-  result = INLINE_SYSCALL (pread, 4, fd, buf, count, offset);
-#else
-  result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
-                          __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                            (off_t) (offset & 0xffffffff)));
-#endif
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
 }
 
 weak_alias (__libc_pread64, __pread64)
index 2c38e0406017c96346c97856c102f5eefa6af876..f4d71d4ae8720a93445f60af5d2634ce4172efb9 100644 (file)
 ssize_t
 __libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
 {
-  ssize_t result;
-
 #if _MIPS_SIM != _ABI64
   assert (sizeof (offset) == 4);
 #endif
 
-  if (SINGLE_THREAD_P)
-    {
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-      result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
-#else
-      result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
-                              __LONG_LONG_PAIR (offset >> 31, offset));
-#endif
-      return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
 #if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-  result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
+  return SYSCALL_CANCEL (pwrite, fd, buf, count, offset);
 #else
-  result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
-                          __LONG_LONG_PAIR (offset >> 31, offset));
+  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
+                        __LONG_LONG_PAIR (offset >> 31, offset));
 #endif
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
 }
 
 strong_alias (__libc_pwrite, __pwrite)
index 504c88aa105fa42a5cb0c32a64ba422b1159ba44..ac0dc408fe22551513af442eb4e430514eda2831 100644 (file)
 ssize_t
 __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
 #if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-      result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
+  return SYSCALL_CANCEL (pwrite, fd, buf, count, offset);
 #else
-     result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
-                             __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                            (off_t) (offset & 0xffffffff)));
+  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
+                        __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                          (off_t) (offset & 0xffffffff)));
 #endif
-
-     return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-  result = INLINE_SYSCALL (pwrite, 4, fd, buf, count, offset);
-#else
-  result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
-                          __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                            (off_t) (offset & 0xffffffff)));
-#endif
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
 }
 
 weak_alias (__libc_pwrite64, __pwrite64)
index 1c3698c2f5668c55cb451135cd502c1d7c1d7d24..660ff29e2b66e9ce739c0210ce563efe10d5a40d 100644 (file)
@@ -43,16 +43,6 @@ __libc_msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp,
   tmp.msgp = msgp;
   tmp.msgtyp = msgtyp;
 
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg, &tmp);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg,
-                                  &tmp);
-
-   LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (ipc, IPCOP_msgrcv, msqid, msgsz, msgflg, &tmp);
 }
 weak_alias (__libc_msgrcv, msgrcv)
index d548aab104775206ef0f715ec8411c72c9b3d784..dfed53906c5f6a7d20d1fc9cc9af8230f355d559 100644 (file)
 int
 __libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (ipc, 5, IPCOP_msgsnd, msqid, msgsz,
-                          msgflg, (void *) msgp);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (ipc, 5, IPCOP_msgsnd, msqid, msgsz,
-                              msgflg, (void *) msgp);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (ipc, IPCOP_msgsnd, msqid, msgsz, msgflg,
+                        (void *) msgp);
 }
 weak_alias (__libc_msgsnd, msgsnd)
index d3ab813ab6b556323ebe9c5267ccd3339a9fdd3b..b90294a5826b248b8138036ef5913c2bebe8208b 100644 (file)
@@ -36,16 +36,7 @@ __libc_open64 (const char *file, int oflag, ...)
       va_end (arg);
     }
 
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (open, 3, file, oflag | O_LARGEFILE, mode);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (open, 3, file, oflag | O_LARGEFILE, mode);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (open, file, oflag | O_LARGEFILE, mode);
 }
 weak_alias (__libc_open64, __open64)
 libc_hidden_weak (__open64)
index 30d8e6e1ac96f70fbd6446325593118e507d047e..677712330e8a01fc39c873b11a07224e5e73ee14 100644 (file)
@@ -68,16 +68,7 @@ __OPENAT (int fd, const char *file, int oflag, ...)
       va_end (arg);
     }
 
-  if (SINGLE_THREAD_P)
-    return OPENAT_NOT_CANCEL (fd, file, oflag, mode);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int res = OPENAT_NOT_CANCEL (fd, file, oflag, mode);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return res;
+  return SYSCALL_CANCEL (openat, fd, file, oflag, mode);
 }
 libc_hidden_def (__OPENAT)
 weak_alias (__OPENAT, OPENAT)
index 10763f563d116deb59380251725938510838e93a..f6b7f43f3f26cddaf72c57826c3dd288646e4e55 100644 (file)
 ssize_t
 __libc_pread (int fd, void *buf, size_t count, off_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
-      /* On PPC32 64bit values are aligned in odd/even register pairs.  */
-      result = INLINE_SYSCALL (pread, 6, fd, buf, count,
-                              0, offset >> 31, offset);
-
-      return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
   /* On PPC32 64bit values are aligned in odd/even register pairs.  */
-  result = INLINE_SYSCALL (pread, 6, fd, buf, count,
-                              0, offset >> 31, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pread, fd, buf, count, 0, offset >> 31, offset);
 }
 
 strong_alias (__libc_pread, __pread)
index f3dc7e56189d67fb6f2d0bc7a1c48f8ae8d741b9..75ee34bccec3c8b02525339767fa93771c86fac8 100644 (file)
 ssize_t
 __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
-      /* On PPC32 64bit values are aligned in odd/even register pairs.  */
-      result = INLINE_SYSCALL (pread, 6, fd, buf, count,
-                              0, (long) (offset >> 32),
-                              (long) offset);
-
-      return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
   /* On PPC32 64bit values are aligned in odd/even register pairs.  */
-  result = INLINE_SYSCALL (pread, 6, fd, buf, count,
-                          0, (long) (offset >> 32),
-                          (long) offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pread, fd, buf, count, 0, (long) (offset >> 32),
+                        (long) offset);
 }
 
 weak_alias (__libc_pread64, __pread64)
index 65109ed54cb73719be55b34d154c1c555b894ee7..fc822d7c8d4fa3cc8f59190fa53b1297250cccd6 100644 (file)
 ssize_t
 __libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
-      /* On PPC32 64bit values are aligned in odd/even register pairs.  */
-      result = INLINE_SYSCALL (pwrite, 6, fd, buf, count,
-                              0, offset >> 31, offset);
-
-      return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
   /* On PPC32 64bit values are aligned in odd/even register pairs.  */
-  result = INLINE_SYSCALL (pwrite, 6, fd, buf, count,
-                          0, offset >> 31, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0, offset >> 31, offset);
 }
 
 strong_alias (__libc_pwrite, __pwrite)
index 77749c98b04297e42af2657efe757626463c60cc..dbeaed8775895add3c5a575e7db697adba786b4d 100644 (file)
 ssize_t
 __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
   /* On PPC32 64bit values are aligned in odd/even register pairs.  */
-      result = INLINE_SYSCALL (pwrite, 6, fd, buf, count,
-                              0, (long) (offset >> 32),
-                              (long) offset);
-
-      return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  /* On PPC32 64bit values are aligned in odd/even register pairs.  */
-  result = INLINE_SYSCALL (pwrite, 6, fd, buf, count,
-                          0, (long) (offset >> 32),
-                          (long) offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0, (long) (offset >> 32),
+                        (long) offset);
 }
 
 weak_alias (__libc_pwrite64, __pwrite64)
index a4f90b6695573c5abd98ed714b209dd621fa2e39..69031bad947892c3b91d1178c8b10972e66dba79 100644 (file)
@@ -53,16 +53,10 @@ __libc_fcntl (int fd, int cmd, ...)
   if (cmd >= F_GETLK64 && cmd <= F_SETLKW64)
     cmd -= F_GETLK64 - F_GETLK;
 
-  if (SINGLE_THREAD_P || cmd != F_SETLKW)
+  if (cmd != F_SETLKW)
     return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
 
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (fcntl, fd, cmd, arg);
 }
 libc_hidden_def (__libc_fcntl)
 
index 18bb0dd4782fad7ecbfa2ea90bc49a230832a2eb..9f464585816c2e5604fa02e3f485d150287929b0 100644 (file)
 int
 sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (sync_file_range2, 4, fd, flags, from, to);
-
-  int result;
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (sync_file_range2, 4, fd, flags, from, to);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (sync_file_range2, fd, flags, from, to);
 }
 #else
 int
index 6e834243181162ed046d4f0dad7be435ab28c07c..77a2e7e17c5652e68745bd03bf8fdd247d1469b0 100644 (file)
@@ -47,17 +47,7 @@ ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
 
   int result;
 
-  if (SINGLE_THREAD_P)
-    result = INLINE_SYSCALL (ppoll, 5, fds, nfds, timeout, sigmask, _NSIG / 8);
-  else
-    {
-      int oldtype = LIBC_CANCEL_ASYNC ();
-
-      result = INLINE_SYSCALL (ppoll, 5, fds, nfds, timeout, sigmask,
-                              _NSIG / 8);
-
-      LIBC_CANCEL_RESET (oldtype);
-    }
+  result = SYSCALL_CANCEL (ppoll, fds, nfds, timeout, sigmask, _NSIG / 8);
 
 # ifndef __ASSUME_PPOLL
   if (result == -1 && errno == ENOSYS)
index 5c1b1743820a4ed71b2e859467e993e7810a872a..09389e477a5827850f395716f670f63acc98fece 100644 (file)
 #endif
 
 
-static ssize_t
-#ifdef NO_CANCELLATION
-inline __attribute ((always_inline))
-#endif
-do_pread (int fd, void *buf, size_t count, off_t offset)
+ssize_t
+__libc_pread (int fd, void *buf, size_t count, off_t offset)
 {
   ssize_t result;
 
   assert (sizeof (offset) == 4);
-  result = INLINE_SYSCALL (pread, 5, fd, buf, count,
+  result = SYSCALL_CANCEL (pread, fd, buf, count,
                           __LONG_LONG_PAIR (offset >> 31, offset));
 
   return result;
 }
 
-
-ssize_t
-__libc_pread (int fd, void *buf, size_t count, off_t offset)
-{
-  if (SINGLE_THREAD_P)
-    return do_pread (fd, buf, count, offset);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = do_pread (fd, buf, count, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-}
-
 strong_alias (__libc_pread, __pread)
 weak_alias (__libc_pread, pread)
index a8cfb5ddf9daea81d1163341cb6e4bbe085703b5..baf23555f0a8295fb065f2d85a3aba07bfbf3419 100644 (file)
 #endif
 
 
-static ssize_t
-do_pread64 (int fd, void *buf, size_t count, off64_t offset)
-{
-  ssize_t result;
-
-  result = INLINE_SYSCALL (pread, 5, fd, buf, count,
-                          __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                            (off_t) (offset & 0xffffffff)));
-
-  return result;
-}
-
-
 ssize_t
 __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
 {
-  if (SINGLE_THREAD_P)
-    return do_pread64 (fd, buf, count, offset);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = do_pread64 (fd, buf, count, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pread, fd, buf, count,
+                        __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                          (off_t) (offset & 0xffffffff)));
 }
 
 weak_alias (__libc_pread64, __pread64)
index 091f9a7dc99cceeb895103eb6604619def9b65ff..2d08be403540c3090a278cdb4fc696579d397632 100644 (file)
@@ -53,18 +53,8 @@ PREADV (int fd, const struct iovec *vector, int count, OFF_T offset)
 #ifdef __NR_preadv
   ssize_t result;
 
-  if (SINGLE_THREAD_P)
-    result = INLINE_SYSCALL (preadv, 5, fd, vector, count,
-                            LO_HI_LONG (offset));
-  else
-    {
-      int oldtype = LIBC_CANCEL_ASYNC ();
-
-      result = INLINE_SYSCALL (preadv, 5, fd, vector, count,
-                              LO_HI_LONG (offset));
-
-      LIBC_CANCEL_RESET (oldtype);
-    }
+  result = SYSCALL_CANCEL (preadv, fd, vector, count, LO_HI_LONG (offset));
+
 # ifdef __ASSUME_PREADV
   return result;
 # endif
index f342a137da10b7219eec6be5488ed9f58253aaf7..30d51d7902d5ebd40645c62a506f0f167b4d9e2e 100644 (file)
@@ -63,22 +63,11 @@ __pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
 
 #ifndef CALL_PSELECT6
 # define CALL_PSELECT6(nfds, readfds, writefds, exceptfds, timeout, data) \
-  INLINE_SYSCALL (pselect6, 6, nfds, readfds, writefds, exceptfds,           \
-                 timeout, data)
+  SYSCALL_CANCEL (pselect6, nfds, readfds, writefds, exceptfds,        timeout, data)
 #endif
 
-  if (SINGLE_THREAD_P)
-    result = CALL_PSELECT6 (nfds, readfds, writefds, exceptfds, timeout,
-                           &data);
-  else
-    {
-      int oldtype = LIBC_CANCEL_ASYNC ();
-
-      result = CALL_PSELECT6 (nfds, readfds, writefds, exceptfds, timeout,
-                             &data);
-
-      LIBC_CANCEL_RESET (oldtype);
-    }
+  result = CALL_PSELECT6 (nfds, readfds, writefds, exceptfds, timeout,
+                         &data);
 
 # ifndef __ASSUME_PSELECT
   if (result == -1 && errno == ENOSYS)
index 80c2e22ebf4d441ea583ff535118b098f5b4bc21..b77985d2d15a0728b55d6f6ffa758f3c3be8caf1 100644 (file)
 #endif
 
 
-static ssize_t
-#ifdef NO_CANCELLATION
-inline __attribute ((always_inline))
-#endif
-do_pwrite (int fd, const void *buf, size_t count, off_t offset)
+ssize_t
+__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
 {
   ssize_t result;
 
   assert (sizeof (offset) == 4);
-  result = INLINE_SYSCALL (pwrite, 5, fd, buf, count,
+  result = SYSCALL_CANCEL (pwrite, fd, buf, count,
                           __LONG_LONG_PAIR (offset >> 31, offset));
 
   return result;
 }
 
-
-ssize_t
-__libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
-{
-  if (SINGLE_THREAD_P)
-    return do_pwrite (fd, buf, count, offset);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = do_pwrite (fd, buf, count, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-}
-
 strong_alias (__libc_pwrite, __pwrite)
 weak_alias (__libc_pwrite, pwrite)
index 7fce75a4328661a5acebd83f0f2785783378d157..a5d0fb7a022c3ea17806c9e6f0f70af47a145329 100644 (file)
 #endif
 
 
-static ssize_t
-do_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
-{
-  ssize_t result;
-
-  result = INLINE_SYSCALL (pwrite, 5, fd, buf, count,
-                          __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                            (off_t) (offset & 0xffffffff)));
-
-  return result;
-}
-
-
 ssize_t
 __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
 {
-  if (SINGLE_THREAD_P)
-    return do_pwrite64 (fd, buf, count, offset);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = do_pwrite64 (fd, buf, count, offset);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pwrite, fd, buf, count,
+                        __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                          (off_t) (offset & 0xffffffff)));
 }
-
 weak_alias (__libc_pwrite64, __pwrite64)
 libc_hidden_weak (__pwrite64)
 weak_alias (__libc_pwrite64, pwrite64)
index 91e58b54ba74d7869f2a5759594cb31ba52d40dd..7aa92387ec307ba1a06d7bb2c7b9b72e94aa8c22 100644 (file)
@@ -53,18 +53,8 @@ PWRITEV (int fd, const struct iovec *vector, int count, OFF_T offset)
 #ifdef __NR_pwritev
   ssize_t result;
 
-  if (SINGLE_THREAD_P)
-    result = INLINE_SYSCALL (pwritev, 5, fd, vector, count,
-                            LO_HI_LONG (offset));
-  else
-    {
-      int oldtype = LIBC_CANCEL_ASYNC ();
-
-      result = INLINE_SYSCALL (pwritev, 5, fd, vector, count,
-                            LO_HI_LONG (offset));
-
-      LIBC_CANCEL_RESET (oldtype);
-    }
+  result = SYSCALL_CANCEL (pwritev, fd, vector, count, LO_HI_LONG (offset));
+
 # ifdef __ASSUME_PWRITEV
   return result;
 # endif
index 1f9f04d3609a0bc7702fd4174cbed2fe756dcfcc..8c6cf2c70019c22a343620ff239e2440664cc609 100644 (file)
@@ -37,16 +37,7 @@ int
 recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
          struct timespec *tmo)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (recvmmsg, 5, fd, vmessages, vlen, flags, tmo);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (recvmmsg, 5, fd, vmessages, vlen, flags, tmo);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, tmo);
 }
 #elif defined __NR_socketcall
 # include <socketcall.h>
index e535cc020786f81aaa86fe9fe506b06589f02ca6..67b7ca9bfc9d63320fde1cceb95f81336a340f33 100644 (file)
 int
 __sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (sendmmsg, 4, fd, vmessages, vlen, flags);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = INLINE_SYSCALL (sendmmsg, 4, fd, vmessages, vlen, flags);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (sendmmsg, fd, vmessages, vlen, flags);
 }
 libc_hidden_def (__sendmmsg)
 weak_alias (__sendmmsg, sendmmsg)
index 9d4b5de7515ea8f25f2c63cf37f884f7f85b6b1c..2f926b33055eaa3589f6235109ad40283dd8c03c 100644 (file)
 ssize_t
 __libc_pread (int fd, void *buf, size_t count, off_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
-      result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
-                              __LONG_LONG_PAIR (offset >> 31, offset));
-      return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
-                          __LONG_LONG_PAIR (offset >> 31, offset));
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pread, fd, buf, count, 0,
+                        __LONG_LONG_PAIR (offset >> 31, offset));
 }
 
 strong_alias (__libc_pread, __pread)
index 195eacc29a0f5cf0fcd43cfa1e91dfe353daf7f2..697718d41b52a6b24daf8b9cd5ee2ac95a366ee5 100644 (file)
 ssize_t
 __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
-     result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
-                             __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                             (off_t) (offset & 0xffffffff)));
-     return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
-                          __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                            (off_t) (offset & 0xffffffff)));
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pread, fd, buf, count, 0,
+                        __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                          (off_t) (offset & 0xffffffff)));
 }
 
 weak_alias (__libc_pread64, __pread64)
index c187d0a732af69745db81ff3ff70bac45f9c44ea..fcbb7fc94ffab643f47a267673e15e8827b8a49e 100644 (file)
 ssize_t
 __libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
-      result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
-                              __LONG_LONG_PAIR (offset >> 31, offset));
-      return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
-                          __LONG_LONG_PAIR (offset >> 31, offset));
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
+                        __LONG_LONG_PAIR (offset >> 31, offset));
 }
 
 strong_alias (__libc_pwrite, __pwrite)
index 0d15ca21e8b8f620ebf3cad20f8feeab4883cdf2..0c189feb0bffea3a0a5a63af0a2b0ba12bb55378 100644 (file)
 ssize_t
 __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
 {
-  ssize_t result;
-
-  if (SINGLE_THREAD_P)
-    {
-     result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
-                             __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                            (off_t) (offset & 0xffffffff)));
-
-     return result;
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
-                          __LONG_LONG_PAIR ((off_t) (offset >> 32),
-                                            (off_t) (offset & 0xffffffff)));
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
+                        __LONG_LONG_PAIR ((off_t) (offset >> 32),
+                                          (off_t) (offset & 0xffffffff)));
 }
 
 weak_alias (__libc_pwrite64, __pwrite64)
index 89c5d65d2262ea0ed1c0e54643d8c6d174e389e9..9047623972d6a689b1b4613c01ad17f846af1664 100644 (file)
 #include <sysdep-cancel.h>
 #include <sys/syscall.h>
 
-
-static inline int __attribute__ ((always_inline))
-do_sigsuspend (const sigset_t *set)
-{
-  return INLINE_SYSCALL (rt_sigsuspend, 2, set, _NSIG / 8);
-}
-
 /* Change the set of blocked signals to SET,
    wait until a signal arrives, and restore the set of blocked signals.  */
 int
 __sigsuspend (const sigset_t *set)
 {
-  if (SINGLE_THREAD_P)
-    return do_sigsuspend (set);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  int result = do_sigsuspend (set);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (rt_sigsuspend, set, _NSIG / 8);
 }
 libc_hidden_def (__sigsuspend)
 weak_alias (__sigsuspend, sigsuspend)
 strong_alias (__sigsuspend, __libc_sigsuspend)
-
-#ifndef NO_CANCELLATION
-int
-__sigsuspend_nocancel (set)
-     const sigset_t *set;
-{
-  return do_sigsuspend (set);
-}
-#endif
index 209198ea1468e2e7544b10ebb690d25fd8f30411..a2e5b4129baed6bc03a1b1aead2cf212545ed065 100644 (file)
@@ -25,9 +25,9 @@
 
 #ifdef __NR_rt_sigtimedwait
 
-static int
-do_sigtimedwait (const sigset_t *set, siginfo_t *info,
-                const struct timespec *timeout)
+int
+__sigtimedwait (const sigset_t *set, siginfo_t *info,
+               const struct timespec *timeout)
 {
 #ifdef SIGCANCEL
   sigset_t tmpset;
@@ -51,8 +51,7 @@ do_sigtimedwait (const sigset_t *set, siginfo_t *info,
 
     /* XXX The size argument hopefully will have to be changed to the
        real size of the user-level sigset_t.  */
-  int result = INLINE_SYSCALL (rt_sigtimedwait, 4, set,
-                              info, timeout, _NSIG / 8);
+  int result = SYSCALL_CANCEL (rt_sigtimedwait, set, info, timeout, _NSIG / 8);
 
   /* The kernel generates a SI_TKILL code in si_code in case tkill is
      used.  tkill is transparently used in raise().  Since having
@@ -63,26 +62,6 @@ do_sigtimedwait (const sigset_t *set, siginfo_t *info,
 
   return result;
 }
-
-
-/* Return any pending signal or wait for one for the given time.  */
-int
-__sigtimedwait (const sigset_t *set, siginfo_t *info,
-               const struct timespec *timeout)
-{
-  if (SINGLE_THREAD_P)
-    return do_sigtimedwait (set, info, timeout);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  /* XXX The size argument hopefully will have to be changed to the
-     real size of the user-level sigset_t.  */
-  int result = do_sigtimedwait (set, info, timeout);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-}
 libc_hidden_def (__sigtimedwait)
 weak_alias (__sigtimedwait, sigtimedwait)
 #else
index fe23c9fe064ca41a6b1caa32c4601dabe2a61451..47e6dd6bddba3b020bb50f53a63d15a9d4091fd4 100644 (file)
@@ -27,8 +27,9 @@
 
 #ifdef __NR_rt_sigtimedwait
 
-static int
-do_sigwaitinfo (const sigset_t *set, siginfo_t *info)
+/* Return any pending signal or wait for one for the given time.  */
+int
+__sigwaitinfo (const sigset_t *set, siginfo_t *info)
 {
 #ifdef SIGCANCEL
   sigset_t tmpset;
@@ -52,8 +53,7 @@ do_sigwaitinfo (const sigset_t *set, siginfo_t *info)
 
   /* XXX The size argument hopefully will have to be changed to the
      real size of the user-level sigset_t.  */
-  int result = INLINE_SYSCALL (rt_sigtimedwait, 4, set,
-                              info, NULL, _NSIG / 8);
+  int result = SYSCALL_CANCEL (rt_sigtimedwait, set, info, NULL, _NSIG / 8);
 
   /* The kernel generates a SI_TKILL code in si_code in case tkill is
      used.  tkill is transparently used in raise().  Since having
@@ -65,24 +65,6 @@ do_sigwaitinfo (const sigset_t *set, siginfo_t *info)
   return result;
 }
 
-
-/* Return any pending signal or wait for one for the given time.  */
-int
-__sigwaitinfo (const sigset_t *set, siginfo_t *info)
-{
-  if (SINGLE_THREAD_P)
-    return do_sigwaitinfo (set, info);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  /* XXX The size argument hopefully will have to be changed to the
-     real size of the user-level sigset_t.  */
-  int result = do_sigwaitinfo (set, info);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
-}
 libc_hidden_def (__sigwaitinfo)
 weak_alias (__sigwaitinfo, sigwaitinfo)
 #else
index 892806046fbbedbc96facb776b06fc8b86ff7e8b..169ac532b361886c010f19e6979b6c92b4c6d40b 100644 (file)
@@ -26,17 +26,7 @@ ssize_t
 __libc_msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp,
               int msgflg)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (ipc, 6, IPCOP_msgrcv, msqid, msgsz, msgflg,
-                          msgp, msgtyp);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = INLINE_SYSCALL (ipc, 6, IPCOP_msgrcv, msqid, msgsz, msgflg,
-                                  msgp, msgtyp);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (ipc, IPCOP_msgrcv, msqid, msgsz, msgflg,
+                        msgp, msgtyp);
 }
 weak_alias (__libc_msgrcv, msgrcv)
index c07ece0f70f8cda67ab9469fe352920f358ba8d3..2ea6dcfbe6c7568610082f6ac8be524e4487c996 100644 (file)
 int
 sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (sync_file_range, 6, fd,
-                          __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
-                          __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
-                          flags);
-
-  int result;
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (sync_file_range, 6, fd,
-                          __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
-                          __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
-                          flags);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (sync_file_range, fd,
+                        __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+                        __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
+                        flags);
 }
 #elif defined __NR_sync_file_range2
 int
 sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (sync_file_range2, 6, fd, flags,
-                          __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
-                          __LONG_LONG_PAIR ((long) (to >> 32), (long) to));
-
-  int result;
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (sync_file_range2, 6, fd, flags,
-                          __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
-                          __LONG_LONG_PAIR ((long) (to >> 32), (long) to));
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (sync_file_range2, fd, flags,
+                        __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
+                        __LONG_LONG_PAIR ((long) (to >> 32), (long) to));
 }
 #else
 int
index c0f2e1d83f91a63c95b48c91cb9eedede613eff1..f60dd4ddb4f4e1d537c891c1b0fca5ae197c7146 100644 (file)
 int
 __libc_tcdrain (int fd)
 {
-  if (SINGLE_THREAD_P)
-    /* With an argument of 1, TCSBRK for output to be drain.  */
-    return INLINE_SYSCALL (ioctl, 3, fd, TCSBRK, 1);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
   /* With an argument of 1, TCSBRK for output to be drain.  */
-  int result = INLINE_SYSCALL (ioctl, 3, fd, TCSBRK, 1);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (ioctl, fd, TCSBRK, 1);
 }
 weak_alias (__libc_tcdrain, tcdrain)
index 4401a8b3d0e75a16e2b937f2eb00dd492d69e9b6..4cf6ecae7092353a7402818ed9630f63c174580f 100644 (file)
@@ -20,7 +20,7 @@
 #include <setjmp.h>
 #include <signal.h>
 #include <stdbool.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 #include <nptl/pthreadP.h>
 #include "kernel-posix-timers.h"
 
@@ -84,14 +84,9 @@ timer_helper_thread (void *arg)
       /* sigwaitinfo cannot be used here, since it deletes
         SIGCANCEL == SIGTIMER from the set.  */
 
-      int oldtype = LIBC_CANCEL_ASYNC ();
-
       /* XXX The size argument hopefully will have to be changed to the
         real size of the user-level sigset_t.  */
-      int result = INLINE_SYSCALL (rt_sigtimedwait, 4, &ss, &si, NULL,
-                                  _NSIG / 8);
-
-      LIBC_CANCEL_RESET (oldtype);
+      int result = SYSCALL_CANCEL (rt_sigtimedwait, &ss, &si, NULL, _NSIG / 8);
 
       if (result > 0)
        {
index 029d97516e2987eb0e169117455e2b691c491ab0..5b76c7c8edee10dca0db45df1a6d76c0dba56346 100644 (file)
 pid_t
 __libc_wait (__WAIT_STATUS_DEFN stat_loc)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (wait4, 4, WAIT_ANY, stat_loc, 0,
-                          (struct rusage *) NULL);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  pid_t result = INLINE_SYSCALL (wait4, 4, WAIT_ANY, stat_loc, 0,
+  pid_t result = SYSCALL_CANCEL (wait4, WAIT_ANY, stat_loc, 0,
                                 (struct rusage *) NULL);
-
-  LIBC_CANCEL_RESET (oldtype);
-
   return result;
 }
 
index 12d5702b5a3367d9060b32aedf6d84134e41423a..71d3a5a3578689757ebc1f3ce14dc528358e179a 100644 (file)
 #include <stddef.h>
 #include <errno.h>
 #include <sys/wait.h>
-#include <sysdep.h>
+#include <sysdep-cancel.h>
 
-static inline int
-do_waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options)
+int
+__waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options)
 {
   /* The unused fifth argument is a `struct rusage *' that we could
      pass if we were using waitid to simulate wait3/wait4.  */
-  return INLINE_SYSCALL (waitid, 5, idtype, id, infop, options, NULL);
+  return SYSCALL_CANCEL (waitid, idtype, id, infop, options, NULL);
 }
-#define NO_DO_WAITID
-
-#include "sysdeps/posix/waitid.c"
+weak_alias (__waitid, waitid)
+strong_alias (__waitid, __libc_waitid)
index 0d780da5283efaf6e0715423fa6c8749872e2676..59d0c9e0bb8509fbfefbcc26f858255e67cdab2d 100644 (file)
 __pid_t
 __waitpid (__pid_t pid, int *stat_loc, int options)
 {
-  if (SINGLE_THREAD_P)
-    {
 #ifdef __NR_waitpid
-      return INLINE_SYSCALL (waitpid, 3, pid, stat_loc, options);
+  return SYSCALL_CANCEL (waitpid, pid, stat_loc, options);
 #else
-      return INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL);
+  return SYSCALL_CANCEL (wait4, pid, stat_loc, options, NULL);
 #endif
-    }
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-#ifdef __NR_waitpid
-  int result = INLINE_SYSCALL (waitpid, 3, pid, stat_loc, options);
-#else
-  int result = INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL);
-#endif
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
 }
 libc_hidden_def (__waitpid)
 weak_alias (__waitpid, waitpid)
index c723fef1655e756329b2c68b27fb6cdfc34439b1..627ac2aa3c4b60b3c38c46a7dbc2679d442745ba 100644 (file)
@@ -25,17 +25,7 @@ int
 fallocate (int fd, int mode, __off_t offset, __off_t len)
 {
 #ifdef __NR_fallocate
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
-
-  int result;
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  result = INLINE_SYSCALL (fallocate, 4, fd, mode, offset, len);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (fallocate, fd, mode, offset, len);
 #else
   __set_errno (ENOSYS);
   return -1;
index 9b3ae700ad945ce1670d69588f37e8101130c4ab..5e22c4b5c9d89d5b02cebca36acde39fed409d29 100644 (file)
@@ -38,16 +38,7 @@ preadv (int fd, const struct iovec *vector, int count, off_t offset)
 #ifdef __NR_preadv
   ssize_t result;
 
-  if (SINGLE_THREAD_P)
-    result = INLINE_SYSCALL (preadv, 4, fd, vector, count, offset);
-  else
-    {
-      int oldtype = LIBC_CANCEL_ASYNC ();
-
-      result = INLINE_SYSCALL (preadv, 4, fd, vector, count, offset);
-
-      LIBC_CANCEL_RESET (oldtype);
-    }
+  result = SYSCALL_CANCEL (preadv, fd, vector, count, offset);
 # ifdef __ASSUME_PREADV
   return result;
 # endif
index 960c8c0f5d3db041435a2fad977d5f29009939dc..ccf96dd65ef2fec9d45aa342bb5dd540e7b4dd8b 100644 (file)
@@ -38,16 +38,7 @@ pwritev (int fd, const struct iovec *vector, int count, off_t offset)
 #ifdef __NR_pwritev
   ssize_t result;
 
-  if (SINGLE_THREAD_P)
-    result = INLINE_SYSCALL (pwritev, 4, fd, vector, count, offset);
-  else
-    {
-      int oldtype = LIBC_CANCEL_ASYNC ();
-
-      result = INLINE_SYSCALL (pwritev, 4, fd, vector, count, offset);
-
-      LIBC_CANCEL_RESET (oldtype);
-    }
+  result = SYSCALL_CANCEL (pwritev, fd, vector, count, offset);
 # ifdef __ASSUME_PWRITEV
   return result;
 # endif
index 7b956a5fe3fc1d70ea164c405b91a09c69a307a7..995d11d3f09d8c064023c26abed3947d8d11942a 100644 (file)
 ssize_t
 __libc_recv (int fd, void *buf, size_t n, int flags)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (recvfrom, 6, fd, buf, n, flags, NULL, NULL);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = INLINE_SYSCALL (recvfrom, 6, fd, buf, n, flags, NULL, NULL);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (recvfrom, fd, buf, n, flags, NULL, NULL);
 }
 
 weak_alias (__libc_recv, __recv)
index c8dadfa89f1216a53a353ccdb1f0a3c3305b6ecd..864a8d50a660098c1dd53b228852b8a400502f9b 100644 (file)
 ssize_t
 __libc_send (int fd, const void *buf, size_t n, int flags)
 {
-  if (SINGLE_THREAD_P)
-    return INLINE_SYSCALL (sendto, 6, fd, buf, n, flags, NULL, (size_t) 0);
-
-  int oldtype = LIBC_CANCEL_ASYNC ();
-
-  ssize_t result = INLINE_SYSCALL (sendto, 6, fd, buf, n, flags, NULL,
-                                  (size_t) 0);
-
-  LIBC_CANCEL_RESET (oldtype);
-
-  return result;
+  return SYSCALL_CANCEL (sendto, fd, buf, n, flags, NULL, (size_t) 0);
 }
 
 weak_alias (__libc_send, __send)