nptl: Rewrite cancellation macros

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.
This commit is contained in:
Adhemerval Zanella 2014-09-28 08:46:23 -03:00 committed by Adhemerval Zanella
parent b65d3e5f0f
commit c6bb095eb5
74 changed files with 303 additions and 1161 deletions

111
ChangeLog
View File

@ -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> 2015-06-04 Nathan Lynch <nathan_lynch@codesourcery.com>
* sysdeps/unix/sysv/linux/arm/Makefile: (sysdep_routines): * sysdeps/unix/sysv/linux/arm/Makefile: (sysdep_routines):

View File

@ -24,6 +24,27 @@
#define SYSCALL__(name, args) PSEUDO (__##name, name, args) #define SYSCALL__(name, args) PSEUDO (__##name, name, args)
#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 /* Machine-dependent sysdep.h files are expected to define the macro
PSEUDO (function_name, syscall_name) to emit assembly code to define the PSEUDO (function_name, syscall_name) to emit assembly code to define the
C-callable function FUNCTION_NAME to do system call SYSCALL_NAME. 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 an instruction such that "MOVE(r1, r0)" works. ret should be defined
as the return instruction. */ as the return instruction. */
#ifndef SYS_ify
#define SYS_ify(syscall_name) SYS_##syscall_name #define SYS_ify(syscall_name) SYS_##syscall_name
#endif
/* Terminate a system call named SYM. This is used on some platforms /* Terminate a system call named SYM. This is used on some platforms
to generate correct debugging information. */ to generate correct debugging information. */
@ -47,4 +70,6 @@
/* Wrappers around system calls should normally inline the system call code. /* Wrappers around system calls should normally inline the system call code.
But sometimes it is not possible or implemented and we use this 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) #define INLINE_SYSCALL(name, nr, args...) __syscall_##name (args)
#endif

View File

@ -37,17 +37,7 @@
int int
accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags) accept4 (int fd, __SOCKADDR_ARG addr, socklen_t *addr_len, int flags)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (accept4, fd, addr.__sockaddr__, addr_len, flags);
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;
} }
#elif defined __NR_socketcall #elif defined __NR_socketcall
# include <socketcall.h> # include <socketcall.h>

View File

@ -26,39 +26,23 @@
#include <kernel-features.h> #include <kernel-features.h>
static int int
do_fdatasync (int fd) __fdatasync (int fd)
{ {
#ifdef __ASSUME_FDATASYNC #ifdef __ASSUME_FDATASYNC
return INLINE_SYSCALL (fdatasync, 1, fd); return SYSCALL_CANCEL (fdatasync, fd);
#elif defined __NR_fdatasync #elif defined __NR_fdatasync
static int __have_no_fdatasync; static int __have_no_fdatasync;
if (!__builtin_expect (__have_no_fdatasync, 0)) 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) if (__builtin_expect (result, 0) != -1 || errno != ENOSYS)
return result; return result;
__have_no_fdatasync = 1; __have_no_fdatasync = 1;
} }
#endif #endif
return INLINE_SYSCALL (fsync, 1, fd); return SYSCALL_CANCEL (fsync, 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;
}
weak_alias (__fdatasync, fdatasync) weak_alias (__fdatasync, fdatasync)

View File

@ -26,28 +26,10 @@
ssize_t ssize_t
__libc_pread (int fd, void *buf, size_t count, off_t offset) __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 /* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */ pairs for syscalls. */
result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0, return SYSCALL_CANCEL (pread64, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset)); __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;
} }
strong_alias (__libc_pread, __pread) strong_alias (__libc_pread, __pread)

View File

@ -26,30 +26,11 @@
ssize_t ssize_t
__libc_pread64 (int fd, void *buf, size_t count, off64_t offset) __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 /* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */ pairs for syscalls. */
result = INLINE_SYSCALL (pread64, 6, fd, buf, count, 0, return SYSCALL_CANCEL (pread64, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32), __LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff))); (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;
} }
weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, __pread64)

View File

@ -26,28 +26,10 @@
ssize_t ssize_t
__libc_pwrite (int fd, const void *buf, size_t count, off_t offset) __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 /* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */ pairs for syscalls. */
result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0, return SYSCALL_CANCEL (pwrite64, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset)); __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;
} }
strong_alias (__libc_pwrite, __pwrite) strong_alias (__libc_pwrite, __pwrite)

View File

@ -26,30 +26,11 @@
ssize_t ssize_t
__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset) __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 /* In the ARM EABI, 64-bit values are aligned to even/odd register
pairs for syscalls. */ pairs for syscalls. */
result = INLINE_SYSCALL (pwrite64, 6, fd, buf, count, 0, return SYSCALL_CANCEL (pwrite64, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32), __LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff))); (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;
} }
weak_alias (__libc_pwrite64, __pwrite64) weak_alias (__libc_pwrite64, __pwrite64)

View File

@ -39,18 +39,8 @@ int epoll_pwait (int epfd, struct epoll_event *events,
int maxevents, int timeout, int maxevents, int timeout,
const sigset_t *set) const sigset_t *set)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (epoll_pwait, epfd, events, maxevents,
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); timeout, set, _NSIG / 8);
LIBC_CANCEL_RESET (oldtype);
return result;
} }
#else #else

View File

@ -25,21 +25,9 @@ int
fallocate (int fd, int mode, __off_t offset, __off_t len) fallocate (int fd, int mode, __off_t offset, __off_t len)
{ {
#ifdef __NR_fallocate #ifdef __NR_fallocate
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (fallocate, fd, mode,
return INLINE_SYSCALL (fallocate, 6, fd, mode,
__LONG_LONG_PAIR (offset >> 31, offset), __LONG_LONG_PAIR (offset >> 31, offset),
__LONG_LONG_PAIR (len >> 31, len)); __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;
#else #else
__set_errno (ENOSYS); __set_errno (ENOSYS);
return -1; return -1;

View File

@ -25,25 +25,11 @@ int
fallocate64 (int fd, int mode, __off64_t offset, __off64_t len) fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
{ {
#ifdef __NR_fallocate #ifdef __NR_fallocate
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (fallocate, fd, mode,
return INLINE_SYSCALL (fallocate, 6, fd, mode,
__LONG_LONG_PAIR ((long int) (offset >> 32), __LONG_LONG_PAIR ((long int) (offset >> 32),
(long int) offset), (long int) offset),
__LONG_LONG_PAIR ((long int) (len >> 32), __LONG_LONG_PAIR ((long int) (len >> 32),
(long int) len)); (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;
#else #else
__set_errno (ENOSYS); __set_errno (ENOSYS);
return -1; return -1;

View File

@ -37,16 +37,7 @@ __libc_open (const char *file, int oflag, ...)
va_end (arg); va_end (arg);
} }
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (openat, AT_FDCWD, file, oflag, mode);
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;
} }
libc_hidden_def (__libc_open) libc_hidden_def (__libc_open)

View File

@ -37,18 +37,7 @@ __libc_open64 (const char *file, int oflag, ...)
va_end (arg); va_end (arg);
} }
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (openat, AT_FDCWD, file, oflag | O_LARGEFILE, mode);
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;
} }
weak_alias (__libc_open64, __open64) weak_alias (__libc_open64, __open64)
libc_hidden_weak (__open64) libc_hidden_weak (__open64)

View File

@ -23,41 +23,17 @@
/* Suspend the process until a signal arrives. /* Suspend the process until a signal arrives.
This always returns -1 and sets errno to EINTR. */ This always returns -1 and sets errno to EINTR. */
static int int
__syscall_pause (void) __libc_pause (void)
{ {
sigset_t set; sigset_t set;
int rc = 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) if (rc == 0)
rc = INLINE_SYSCALL (rt_sigsuspend, 2, &set, _NSIG / 8); rc = SYSCALL_CANCEL (rt_sigsuspend, &set, _NSIG / 8);
return rc; 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) weak_alias (__libc_pause, pause)
#ifndef NO_CANCELLATION
# include <not-cancel.h>
int
__pause_nocancel (void)
{
return __syscall_pause ();
}
#endif

View File

@ -35,16 +35,7 @@ __poll (struct pollfd *fds, nfds_t nfds, int timeout)
timeout_ts_p = &timeout_ts; timeout_ts_p = &timeout_ts;
} }
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (ppoll, fds, nfds, timeout_ts_p, NULL, 0);
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;
} }
libc_hidden_def (__poll) libc_hidden_def (__poll)
weak_alias (__poll, poll) weak_alias (__poll, poll)

View File

@ -24,22 +24,8 @@
ssize_t ssize_t
__libc_recv (int sockfd, void *buffer, size_t len, int flags) __libc_recv (int sockfd, void *buffer, size_t len, int flags)
{ {
ssize_t result; return SYSCALL_CANCEL (recvfrom, sockfd, buffer, len, flags,
if (SINGLE_THREAD_P)
result = INLINE_SYSCALL (recvfrom, 6, sockfd, buffer, len, flags,
NULL, NULL); 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;
} }
strong_alias (__libc_recv, __recv) strong_alias (__libc_recv, __recv)
weak_alias (__libc_recv, recv) weak_alias (__libc_recv, recv)

View File

@ -42,20 +42,8 @@ __select(int nfds, fd_set *readfds,
tsp = &ts; tsp = &ts;
} }
if (SINGLE_THREAD_P) result = SYSCALL_CANCEL (pselect6, nfds, readfds, writefds, exceptfds, tsp,
{ NULL);
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);
}
if (timeout) if (timeout)
{ {

View File

@ -24,20 +24,7 @@
ssize_t ssize_t
__libc_send (int sockfd, const void *buffer, size_t len, int flags) __libc_send (int sockfd, const void *buffer, size_t len, int flags)
{ {
ssize_t result; return SYSCALL_CANCEL (sendto, sockfd, buffer, len, flags, NULL, 0);
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;
} }
strong_alias (__libc_send, __send) strong_alias (__libc_send, __send)
weak_alias (__libc_send, send) weak_alias (__libc_send, send)

View File

@ -18,6 +18,7 @@
#include <bits/wordsize.h> #include <bits/wordsize.h>
#include <kernel-features.h> #include <kernel-features.h>
#include <sysdeps/unix/sysdep.h>
/* Provide the common name to allow more code reuse. */ /* Provide the common name to allow more code reuse. */
#define __NR__llseek __NR_llseek #define __NR__llseek __NR_llseek

View File

@ -25,28 +25,13 @@
#include <sysdep-cancel.h> #include <sysdep-cancel.h>
#include <sys/syscall.h> #include <sys/syscall.h>
static ssize_t
do_pread (int fd, void *buf, size_t count, off_t offset)
{
assert (sizeof (offset) == 4);
return INLINE_SYSCALL (pread64, __ALIGNMENT_COUNT (5, 6), fd,
buf, count, __ALIGNMENT_ARG
__LONG_LONG_PAIR (offset >> 31, offset));
}
ssize_t ssize_t
__libc_pread (int fd, void *buf, size_t count, off_t offset) __libc_pread (int fd, void *buf, size_t count, off_t offset)
{ {
if (SINGLE_THREAD_P) assert (sizeof (offset) == 4);
return do_pread (fd, buf, count, offset); return SYSCALL_CANCEL (pread64, fd,
buf, count, __ALIGNMENT_ARG
int oldtype = LIBC_CANCEL_ASYNC (); __LONG_LONG_PAIR (offset >> 31, offset));
ssize_t result = do_pread (fd, buf, count, offset);
LIBC_CANCEL_RESET (oldtype);
return result;
} }
strong_alias (__libc_pread, __pread) strong_alias (__libc_pread, __pread)
weak_alias (__libc_pread, pread) weak_alias (__libc_pread, pread)

View File

@ -24,29 +24,11 @@
#include <sysdep-cancel.h> #include <sysdep-cancel.h>
#include <sys/syscall.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 ssize_t
__libc_pread64 (int fd, void *buf, size_t count, off64_t offset) __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (pread64, fd, buf, count, __ALIGNMENT_ARG
return do_pread64 (fd, buf, count, offset); __LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
int oldtype = LIBC_CANCEL_ASYNC ();
ssize_t result = do_pread64 (fd, buf, count, offset);
LIBC_CANCEL_RESET (oldtype);
return result;
} }
weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, pread64) weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, pread64)

View File

@ -26,28 +26,13 @@
#include <sysdep-cancel.h> #include <sysdep-cancel.h>
#include <sys/syscall.h> #include <sys/syscall.h>
static ssize_t
do_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,
vector, count, __ALIGNMENT_ARG
__LONG_LONG_PAIR (offset >> 31, offset));
}
ssize_t ssize_t
__libc_preadv (int fd, const struct iovec *vector, int count, off_t offset) __libc_preadv (int fd, const struct iovec *vector, int count, off_t offset)
{ {
if (SINGLE_THREAD_P) assert (sizeof (offset) == 4);
return do_preadv (fd, vector, count, offset); return SYSCALL_CANCEL (preadv, fd,
vector, count, __ALIGNMENT_ARG
int oldtype = LIBC_CANCEL_ASYNC (); __LONG_LONG_PAIR (offset >> 31, offset));
ssize_t result = do_preadv (fd, vector, count, offset);
LIBC_CANCEL_RESET (oldtype);
return result;
} }
strong_alias (__libc_preadv, __preadv) strong_alias (__libc_preadv, __preadv)
weak_alias (__libc_preadv, preadv) weak_alias (__libc_preadv, preadv)

View File

@ -25,30 +25,14 @@
#include <sysdep-cancel.h> #include <sysdep-cancel.h>
#include <sys/syscall.h> #include <sys/syscall.h>
static ssize_t ssize_t
do_preadv64 (int fd, const struct iovec *vector, int count, off64_t offset) __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 vector, count, __ALIGNMENT_ARG
__LONG_LONG_PAIR ((off_t) (offset >> 32), __LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff))); (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) strong_alias (__libc_preadv64, __preadv64)
weak_alias (__libc_preadv64, preadv64) weak_alias (__libc_preadv64, preadv64)

View File

@ -25,29 +25,12 @@
#include <sysdep-cancel.h> #include <sysdep-cancel.h>
#include <sys/syscall.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 ssize_t
__libc_pwrite (int fd, const void *buf, size_t count, off_t offset) __libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
{ {
if (SINGLE_THREAD_P) assert (sizeof (offset) == 4);
return do_pwrite (fd, buf, count, offset); return SYSCALL_CANCEL (pwrite64, fd, buf, count, __ALIGNMENT_ARG
__LONG_LONG_PAIR (offset >> 31, 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) strong_alias (__libc_pwrite, __pwrite)
weak_alias (__libc_pwrite, pwrite) weak_alias (__libc_pwrite, pwrite)

View File

@ -24,30 +24,12 @@
#include <sysdep-cancel.h> #include <sysdep-cancel.h>
#include <sys/syscall.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 ssize_t
__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset) __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (pwrite64, fd, buf, count, __ALIGNMENT_ARG
return do_pwrite64 (fd, buf, count, offset); __LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
int oldtype = LIBC_CANCEL_ASYNC ();
ssize_t result = do_pwrite64 (fd, buf, count, offset);
LIBC_CANCEL_RESET (oldtype);
return result;
} }
weak_alias (__libc_pwrite64, __pwrite64) weak_alias (__libc_pwrite64, __pwrite64)
libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64) libc_hidden_weak (__pwrite64) weak_alias (__libc_pwrite64, pwrite64)

View File

@ -26,29 +26,12 @@
#include <sysdep-cancel.h> #include <sysdep-cancel.h>
#include <sys/syscall.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 ssize_t
__libc_pwritev (int fd, const struct iovec *vector, int count, off_t offset) __libc_pwritev (int fd, const struct iovec *vector, int count, off_t offset)
{ {
if (SINGLE_THREAD_P) assert (sizeof (offset) == 4);
return do_pwritev (fd, vector, count, offset); return SYSCALL_CANCEL (pwritev, fd, vector, count, __ALIGNMENT_ARG
__LONG_LONG_PAIR (offset >> 31, offset));
int oldtype = LIBC_CANCEL_ASYNC ();
ssize_t result = do_pwritev (fd, vector, count, offset);
LIBC_CANCEL_RESET (oldtype);
return result;
} }
strong_alias (__libc_pwritev, __pwritev) strong_alias (__libc_pwritev, __pwritev)
weak_alias (__libc_pwritev, pwritev) weak_alias (__libc_pwritev, pwritev)

View File

@ -25,31 +25,14 @@
#include <sysdep-cancel.h> #include <sysdep-cancel.h>
#include <sys/syscall.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 ssize_t
__libc_pwritev64 (int fd, const struct iovec *vector, int count, __libc_pwritev64 (int fd, const struct iovec *vector, int count,
off64_t offset) off64_t offset)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (pwritev, fd,
return do_pwritev64 (fd, vector, count, offset); vector, count, __ALIGNMENT_ARG
__LONG_LONG_PAIR ((off_t) (offset >> 32),
int oldtype = LIBC_CANCEL_ASYNC (); (off_t) (offset & 0xffffffff)));
ssize_t result = do_pwritev64 (fd, vector, count, offset);
LIBC_CANCEL_RESET (oldtype);
return result;
} }
strong_alias (__libc_pwritev64, pwritev64) strong_alias (__libc_pwritev64, pwritev64)
weak_alias (__libc_pwritev64, __pwritev64) weak_alias (__libc_pwritev64, __pwritev64)

View File

@ -49,16 +49,10 @@ __libc_fcntl (int fd, int cmd, ...)
arg = va_arg (ap, void *); arg = va_arg (ap, void *);
va_end (ap); 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); return INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
int oldtype = LIBC_CANCEL_ASYNC (); return SYSCALL_CANCEL (fcntl64, fd, cmd, arg);
int result = INLINE_SYSCALL (fcntl64, 3, fd, cmd, arg);
LIBC_CANCEL_RESET (oldtype);
return result;
} }
libc_hidden_def (__libc_fcntl) libc_hidden_def (__libc_fcntl)

View File

@ -28,23 +28,10 @@
int int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (sync_file_range, fd, 0,
return INLINE_SYSCALL (sync_file_range, 7, fd, 0,
__LONG_LONG_PAIR ((long) (from >> 32), (long) from), __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
__LONG_LONG_PAIR ((long) (to >> 32), (long) to), __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
flags); 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;
} }
#else #else
int int

View File

@ -25,17 +25,7 @@ int
fallocate (int fd, int mode, __off_t offset, __off_t len) fallocate (int fd, int mode, __off_t offset, __off_t len)
{ {
#ifdef __NR_fallocate #ifdef __NR_fallocate
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (fallocate, fd, mode, offset, len);
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;
#else #else
__set_errno (ENOSYS); __set_errno (ENOSYS);
return -1; return -1;

View File

@ -25,17 +25,7 @@ int
fallocate64 (int fd, int mode, __off64_t offset, __off64_t len) fallocate64 (int fd, int mode, __off64_t offset, __off64_t len)
{ {
#ifdef __NR_fallocate #ifdef __NR_fallocate
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (fallocate, fd, mode, offset, len);
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;
#else #else
__set_errno (ENOSYS); __set_errno (ENOSYS);
return -1; return -1;

View File

@ -38,35 +38,16 @@
ssize_t ssize_t
__libc_pread (int fd, void *buf, size_t count, off_t offset) __libc_pread (int fd, void *buf, size_t count, off_t offset)
{ {
ssize_t result;
#if _MIPS_SIM != _ABI64 #if _MIPS_SIM != _ABI64
assert (sizeof (offset) == 4); assert (sizeof (offset) == 4);
#endif #endif
if (SINGLE_THREAD_P)
{
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 #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 #else
result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, return SYSCALL_CANCEL (pread, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset)); __LONG_LONG_PAIR (offset >> 31, offset));
#endif #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 (offset >> 31, offset));
#endif
LIBC_CANCEL_RESET (oldtype);
return result;
} }
strong_alias (__libc_pread, __pread) strong_alias (__libc_pread, __pread)

View File

@ -37,34 +37,13 @@
ssize_t ssize_t
__libc_pread64 (int fd, void *buf, size_t count, off64_t offset) __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 #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 #else
result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0, return SYSCALL_CANCEL (pread, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32), __LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff))); (off_t) (offset & 0xffffffff)));
#endif #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) weak_alias (__libc_pread64, __pread64)

View File

@ -38,35 +38,16 @@
ssize_t ssize_t
__libc_pwrite (int fd, const void *buf, size_t count, off_t offset) __libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
{ {
ssize_t result;
#if _MIPS_SIM != _ABI64 #if _MIPS_SIM != _ABI64
assert (sizeof (offset) == 4); assert (sizeof (offset) == 4);
#endif #endif
if (SINGLE_THREAD_P)
{
#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64 #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 #else
result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset)); __LONG_LONG_PAIR (offset >> 31, offset));
#endif #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 (offset >> 31, offset));
#endif
LIBC_CANCEL_RESET (oldtype);
return result;
} }
strong_alias (__libc_pwrite, __pwrite) strong_alias (__libc_pwrite, __pwrite)

View File

@ -37,34 +37,13 @@
ssize_t ssize_t
__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset) __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 #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 #else
result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0, return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32), __LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff))); (off_t) (offset & 0xffffffff)));
#endif #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) weak_alias (__libc_pwrite64, __pwrite64)

View File

@ -43,16 +43,6 @@ __libc_msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp,
tmp.msgp = msgp; tmp.msgp = msgp;
tmp.msgtyp = msgtyp; tmp.msgtyp = msgtyp;
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (ipc, IPCOP_msgrcv, msqid, msgsz, msgflg, &tmp);
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;
} }
weak_alias (__libc_msgrcv, msgrcv) weak_alias (__libc_msgrcv, msgrcv)

View File

@ -26,17 +26,7 @@
int int
__libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg) __libc_msgsnd (int msqid, const void *msgp, size_t msgsz, int msgflg)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (ipc, IPCOP_msgsnd, msqid, msgsz, msgflg,
return INLINE_SYSCALL (ipc, 5, IPCOP_msgsnd, msqid, msgsz, (void *) msgp);
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;
} }
weak_alias (__libc_msgsnd, msgsnd) weak_alias (__libc_msgsnd, msgsnd)

View File

@ -36,16 +36,7 @@ __libc_open64 (const char *file, int oflag, ...)
va_end (arg); va_end (arg);
} }
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (open, file, oflag | O_LARGEFILE, mode);
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;
} }
weak_alias (__libc_open64, __open64) weak_alias (__libc_open64, __open64)
libc_hidden_weak (__open64) libc_hidden_weak (__open64)

View File

@ -68,16 +68,7 @@ __OPENAT (int fd, const char *file, int oflag, ...)
va_end (arg); va_end (arg);
} }
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (openat, fd, file, oflag, mode);
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;
} }
libc_hidden_def (__OPENAT) libc_hidden_def (__OPENAT)
weak_alias (__OPENAT, OPENAT) weak_alias (__OPENAT, OPENAT)

View File

@ -26,26 +26,8 @@
ssize_t ssize_t
__libc_pread (int fd, void *buf, size_t count, off_t offset) __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. */ /* On PPC32 64bit values are aligned in odd/even register pairs. */
result = INLINE_SYSCALL (pread, 6, fd, buf, count, return SYSCALL_CANCEL (pread, fd, buf, count, 0, offset >> 31, offset);
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;
} }
strong_alias (__libc_pread, __pread) strong_alias (__libc_pread, __pread)

View File

@ -26,28 +26,9 @@
ssize_t ssize_t
__libc_pread64 (int fd, void *buf, size_t count, off64_t offset) __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. */ /* On PPC32 64bit values are aligned in odd/even register pairs. */
result = INLINE_SYSCALL (pread, 6, fd, buf, count, return SYSCALL_CANCEL (pread, fd, buf, count, 0, (long) (offset >> 32),
0, (long) (offset >> 32),
(long) offset); (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;
} }
weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, __pread64)

View File

@ -27,26 +27,8 @@
ssize_t ssize_t
__libc_pwrite (int fd, const void *buf, size_t count, off_t offset) __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. */ /* On PPC32 64bit values are aligned in odd/even register pairs. */
result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, return SYSCALL_CANCEL (pwrite, fd, buf, count, 0, offset >> 31, offset);
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;
} }
strong_alias (__libc_pwrite, __pwrite) strong_alias (__libc_pwrite, __pwrite)

View File

@ -26,28 +26,9 @@
ssize_t ssize_t
__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset) __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. */ /* On PPC32 64bit values are aligned in odd/even register pairs. */
result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, return SYSCALL_CANCEL (pwrite, fd, buf, count, 0, (long) (offset >> 32),
0, (long) (offset >> 32),
(long) offset); (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;
} }
weak_alias (__libc_pwrite64, __pwrite64) weak_alias (__libc_pwrite64, __pwrite64)

View File

@ -53,16 +53,10 @@ __libc_fcntl (int fd, int cmd, ...)
if (cmd >= F_GETLK64 && cmd <= F_SETLKW64) if (cmd >= F_GETLK64 && cmd <= F_SETLKW64)
cmd -= F_GETLK64 - F_GETLK; cmd -= F_GETLK64 - F_GETLK;
if (SINGLE_THREAD_P || cmd != F_SETLKW) if (cmd != F_SETLKW)
return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg); return INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
int oldtype = LIBC_CANCEL_ASYNC (); return SYSCALL_CANCEL (fcntl, fd, cmd, arg);
int result = INLINE_SYSCALL (fcntl, 3, fd, cmd, arg);
LIBC_CANCEL_RESET (oldtype);
return result;
} }
libc_hidden_def (__libc_fcntl) libc_hidden_def (__libc_fcntl)

View File

@ -28,17 +28,7 @@
int int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (sync_file_range2, fd, flags, from, to);
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;
} }
#else #else
int int

View File

@ -47,17 +47,7 @@ ppoll (struct pollfd *fds, nfds_t nfds, const struct timespec *timeout,
int result; int result;
if (SINGLE_THREAD_P) result = SYSCALL_CANCEL (ppoll, fds, nfds, timeout, sigmask, _NSIG / 8);
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);
}
# ifndef __ASSUME_PPOLL # ifndef __ASSUME_PPOLL
if (result == -1 && errno == ENOSYS) if (result == -1 && errno == ENOSYS)

View File

@ -32,36 +32,17 @@
#endif #endif
static ssize_t ssize_t
#ifdef NO_CANCELLATION __libc_pread (int fd, void *buf, size_t count, off_t offset)
inline __attribute ((always_inline))
#endif
do_pread (int fd, void *buf, size_t count, off_t offset)
{ {
ssize_t result; ssize_t result;
assert (sizeof (offset) == 4); 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)); __LONG_LONG_PAIR (offset >> 31, offset));
return result; 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) strong_alias (__libc_pread, __pread)
weak_alias (__libc_pread, pread) weak_alias (__libc_pread, pread)

View File

@ -31,32 +31,12 @@
#endif #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 ssize_t
__libc_pread64 (int fd, void *buf, size_t count, off64_t offset) __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (pread, fd, buf, count,
return do_pread64 (fd, buf, count, offset); __LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
int oldtype = LIBC_CANCEL_ASYNC ();
ssize_t result = do_pread64 (fd, buf, count, offset);
LIBC_CANCEL_RESET (oldtype);
return result;
} }
weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, __pread64)

View File

@ -53,18 +53,8 @@ PREADV (int fd, const struct iovec *vector, int count, OFF_T offset)
#ifdef __NR_preadv #ifdef __NR_preadv
ssize_t result; ssize_t result;
if (SINGLE_THREAD_P) result = SYSCALL_CANCEL (preadv, fd, vector, count, LO_HI_LONG (offset));
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);
}
# ifdef __ASSUME_PREADV # ifdef __ASSUME_PREADV
return result; return result;
# endif # endif

View File

@ -63,22 +63,11 @@ __pselect (int nfds, fd_set *readfds, fd_set *writefds, fd_set *exceptfds,
#ifndef CALL_PSELECT6 #ifndef CALL_PSELECT6
# define CALL_PSELECT6(nfds, readfds, writefds, exceptfds, timeout, data) \ # define CALL_PSELECT6(nfds, readfds, writefds, exceptfds, timeout, data) \
INLINE_SYSCALL (pselect6, 6, nfds, readfds, writefds, exceptfds, \ SYSCALL_CANCEL (pselect6, nfds, readfds, writefds, exceptfds, timeout, data)
timeout, data)
#endif #endif
if (SINGLE_THREAD_P)
result = CALL_PSELECT6 (nfds, readfds, writefds, exceptfds, timeout, result = CALL_PSELECT6 (nfds, readfds, writefds, exceptfds, timeout,
&data); &data);
else
{
int oldtype = LIBC_CANCEL_ASYNC ();
result = CALL_PSELECT6 (nfds, readfds, writefds, exceptfds, timeout,
&data);
LIBC_CANCEL_RESET (oldtype);
}
# ifndef __ASSUME_PSELECT # ifndef __ASSUME_PSELECT
if (result == -1 && errno == ENOSYS) if (result == -1 && errno == ENOSYS)

View File

@ -32,36 +32,17 @@
#endif #endif
static ssize_t ssize_t
#ifdef NO_CANCELLATION __libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
inline __attribute ((always_inline))
#endif
do_pwrite (int fd, const void *buf, size_t count, off_t offset)
{ {
ssize_t result; ssize_t result;
assert (sizeof (offset) == 4); 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)); __LONG_LONG_PAIR (offset >> 31, offset));
return result; 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) strong_alias (__libc_pwrite, __pwrite)
weak_alias (__libc_pwrite, pwrite) weak_alias (__libc_pwrite, pwrite)

View File

@ -31,34 +31,13 @@
#endif #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 ssize_t
__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset) __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (pwrite, fd, buf, count,
return do_pwrite64 (fd, buf, count, offset); __LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff)));
int oldtype = LIBC_CANCEL_ASYNC ();
ssize_t result = do_pwrite64 (fd, buf, count, offset);
LIBC_CANCEL_RESET (oldtype);
return result;
} }
weak_alias (__libc_pwrite64, __pwrite64) weak_alias (__libc_pwrite64, __pwrite64)
libc_hidden_weak (__pwrite64) libc_hidden_weak (__pwrite64)
weak_alias (__libc_pwrite64, pwrite64) weak_alias (__libc_pwrite64, pwrite64)

View File

@ -53,18 +53,8 @@ PWRITEV (int fd, const struct iovec *vector, int count, OFF_T offset)
#ifdef __NR_pwritev #ifdef __NR_pwritev
ssize_t result; ssize_t result;
if (SINGLE_THREAD_P) result = SYSCALL_CANCEL (pwritev, fd, vector, count, LO_HI_LONG (offset));
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);
}
# ifdef __ASSUME_PWRITEV # ifdef __ASSUME_PWRITEV
return result; return result;
# endif # endif

View File

@ -37,16 +37,7 @@ int
recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags, recvmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags,
struct timespec *tmo) struct timespec *tmo)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (recvmmsg, fd, vmessages, vlen, flags, tmo);
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;
} }
#elif defined __NR_socketcall #elif defined __NR_socketcall
# include <socketcall.h> # include <socketcall.h>

View File

@ -36,16 +36,7 @@
int int
__sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags) __sendmmsg (int fd, struct mmsghdr *vmessages, unsigned int vlen, int flags)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (sendmmsg, fd, vmessages, vlen, flags);
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;
} }
libc_hidden_def (__sendmmsg) libc_hidden_def (__sendmmsg)
weak_alias (__sendmmsg, sendmmsg) weak_alias (__sendmmsg, sendmmsg)

View File

@ -35,23 +35,8 @@
ssize_t ssize_t
__libc_pread (int fd, void *buf, size_t count, off_t offset) __libc_pread (int fd, void *buf, size_t count, off_t offset)
{ {
ssize_t result; return SYSCALL_CANCEL (pread, fd, buf, count, 0,
if (SINGLE_THREAD_P)
{
result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset)); __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;
} }
strong_alias (__libc_pread, __pread) strong_alias (__libc_pread, __pread)

View File

@ -34,25 +34,9 @@
ssize_t ssize_t
__libc_pread64 (int fd, void *buf, size_t count, off64_t offset) __libc_pread64 (int fd, void *buf, size_t count, off64_t offset)
{ {
ssize_t result; return SYSCALL_CANCEL (pread, fd, buf, count, 0,
if (SINGLE_THREAD_P)
{
result = INLINE_SYSCALL (pread, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32), __LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff))); (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;
} }
weak_alias (__libc_pread64, __pread64) weak_alias (__libc_pread64, __pread64)

View File

@ -35,23 +35,8 @@
ssize_t ssize_t
__libc_pwrite (int fd, const void *buf, size_t count, off_t offset) __libc_pwrite (int fd, const void *buf, size_t count, off_t offset)
{ {
ssize_t result; return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
if (SINGLE_THREAD_P)
{
result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR (offset >> 31, offset)); __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;
} }
strong_alias (__libc_pwrite, __pwrite) strong_alias (__libc_pwrite, __pwrite)

View File

@ -34,26 +34,9 @@
ssize_t ssize_t
__libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset) __libc_pwrite64 (int fd, const void *buf, size_t count, off64_t offset)
{ {
ssize_t result; return SYSCALL_CANCEL (pwrite, fd, buf, count, 0,
if (SINGLE_THREAD_P)
{
result = INLINE_SYSCALL (pwrite, 6, fd, buf, count, 0,
__LONG_LONG_PAIR ((off_t) (offset >> 32), __LONG_LONG_PAIR ((off_t) (offset >> 32),
(off_t) (offset & 0xffffffff))); (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;
} }
weak_alias (__libc_pwrite64, __pwrite64) weak_alias (__libc_pwrite64, __pwrite64)

View File

@ -22,38 +22,13 @@
#include <sysdep-cancel.h> #include <sysdep-cancel.h>
#include <sys/syscall.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, /* Change the set of blocked signals to SET,
wait until a signal arrives, and restore the set of blocked signals. */ wait until a signal arrives, and restore the set of blocked signals. */
int int
__sigsuspend (const sigset_t *set) __sigsuspend (const sigset_t *set)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (rt_sigsuspend, set, _NSIG / 8);
return do_sigsuspend (set);
int oldtype = LIBC_CANCEL_ASYNC ();
int result = do_sigsuspend (set);
LIBC_CANCEL_RESET (oldtype);
return result;
} }
libc_hidden_def (__sigsuspend) libc_hidden_def (__sigsuspend)
weak_alias (__sigsuspend, sigsuspend) weak_alias (__sigsuspend, sigsuspend)
strong_alias (__sigsuspend, __libc_sigsuspend) strong_alias (__sigsuspend, __libc_sigsuspend)
#ifndef NO_CANCELLATION
int
__sigsuspend_nocancel (set)
const sigset_t *set;
{
return do_sigsuspend (set);
}
#endif

View File

@ -25,8 +25,8 @@
#ifdef __NR_rt_sigtimedwait #ifdef __NR_rt_sigtimedwait
static int int
do_sigtimedwait (const sigset_t *set, siginfo_t *info, __sigtimedwait (const sigset_t *set, siginfo_t *info,
const struct timespec *timeout) const struct timespec *timeout)
{ {
#ifdef SIGCANCEL #ifdef SIGCANCEL
@ -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 /* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */ real size of the user-level sigset_t. */
int result = INLINE_SYSCALL (rt_sigtimedwait, 4, set, int result = SYSCALL_CANCEL (rt_sigtimedwait, set, info, timeout, _NSIG / 8);
info, timeout, _NSIG / 8);
/* The kernel generates a SI_TKILL code in si_code in case tkill is /* The kernel generates a SI_TKILL code in si_code in case tkill is
used. tkill is transparently used in raise(). Since having 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 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) libc_hidden_def (__sigtimedwait)
weak_alias (__sigtimedwait, sigtimedwait) weak_alias (__sigtimedwait, sigtimedwait)
#else #else

View File

@ -27,8 +27,9 @@
#ifdef __NR_rt_sigtimedwait #ifdef __NR_rt_sigtimedwait
static int /* Return any pending signal or wait for one for the given time. */
do_sigwaitinfo (const sigset_t *set, siginfo_t *info) int
__sigwaitinfo (const sigset_t *set, siginfo_t *info)
{ {
#ifdef SIGCANCEL #ifdef SIGCANCEL
sigset_t tmpset; 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 /* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */ real size of the user-level sigset_t. */
int result = INLINE_SYSCALL (rt_sigtimedwait, 4, set, int result = SYSCALL_CANCEL (rt_sigtimedwait, set, info, NULL, _NSIG / 8);
info, NULL, _NSIG / 8);
/* The kernel generates a SI_TKILL code in si_code in case tkill is /* The kernel generates a SI_TKILL code in si_code in case tkill is
used. tkill is transparently used in raise(). Since having 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 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) libc_hidden_def (__sigwaitinfo)
weak_alias (__sigwaitinfo, sigwaitinfo) weak_alias (__sigwaitinfo, sigwaitinfo)
#else #else

View File

@ -26,17 +26,7 @@ ssize_t
__libc_msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp, __libc_msgrcv (int msqid, void *msgp, size_t msgsz, long int msgtyp,
int msgflg) int msgflg)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (ipc, IPCOP_msgrcv, msqid, msgsz, msgflg,
return INLINE_SYSCALL (ipc, 6, IPCOP_msgrcv, msqid, msgsz, msgflg,
msgp, msgtyp); 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;
} }
weak_alias (__libc_msgrcv, msgrcv) weak_alias (__libc_msgrcv, msgrcv)

View File

@ -28,43 +28,18 @@
int int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (sync_file_range, fd,
return INLINE_SYSCALL (sync_file_range, 6, fd,
__LONG_LONG_PAIR ((long) (from >> 32), (long) from), __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
__LONG_LONG_PAIR ((long) (to >> 32), (long) to), __LONG_LONG_PAIR ((long) (to >> 32), (long) to),
flags); 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;
} }
#elif defined __NR_sync_file_range2 #elif defined __NR_sync_file_range2
int int
sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags) sync_file_range (int fd, __off64_t from, __off64_t to, unsigned int flags)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (sync_file_range2, fd, flags,
return INLINE_SYSCALL (sync_file_range2, 6, fd, flags,
__LONG_LONG_PAIR ((long) (from >> 32), (long) from), __LONG_LONG_PAIR ((long) (from >> 32), (long) from),
__LONG_LONG_PAIR ((long) (to >> 32), (long) to)); __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;
} }
#else #else
int int

View File

@ -24,17 +24,7 @@
int int
__libc_tcdrain (int fd) __libc_tcdrain (int fd)
{ {
if (SINGLE_THREAD_P)
/* With an argument of 1, TCSBRK for output to be drain. */ /* With an argument of 1, TCSBRK for output to be drain. */
return INLINE_SYSCALL (ioctl, 3, fd, TCSBRK, 1); return SYSCALL_CANCEL (ioctl, 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;
} }
weak_alias (__libc_tcdrain, tcdrain) weak_alias (__libc_tcdrain, tcdrain)

View File

@ -20,7 +20,7 @@
#include <setjmp.h> #include <setjmp.h>
#include <signal.h> #include <signal.h>
#include <stdbool.h> #include <stdbool.h>
#include <sysdep.h> #include <sysdep-cancel.h>
#include <nptl/pthreadP.h> #include <nptl/pthreadP.h>
#include "kernel-posix-timers.h" #include "kernel-posix-timers.h"
@ -84,14 +84,9 @@ timer_helper_thread (void *arg)
/* sigwaitinfo cannot be used here, since it deletes /* sigwaitinfo cannot be used here, since it deletes
SIGCANCEL == SIGTIMER from the set. */ SIGCANCEL == SIGTIMER from the set. */
int oldtype = LIBC_CANCEL_ASYNC ();
/* XXX The size argument hopefully will have to be changed to the /* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */ real size of the user-level sigset_t. */
int result = INLINE_SYSCALL (rt_sigtimedwait, 4, &ss, &si, NULL, int result = SYSCALL_CANCEL (rt_sigtimedwait, &ss, &si, NULL, _NSIG / 8);
_NSIG / 8);
LIBC_CANCEL_RESET (oldtype);
if (result > 0) if (result > 0)
{ {

View File

@ -26,17 +26,8 @@
pid_t pid_t
__libc_wait (__WAIT_STATUS_DEFN stat_loc) __libc_wait (__WAIT_STATUS_DEFN stat_loc)
{ {
if (SINGLE_THREAD_P) pid_t result = SYSCALL_CANCEL (wait4, WAIT_ANY, stat_loc, 0,
return INLINE_SYSCALL (wait4, 4, WAIT_ANY, stat_loc, 0,
(struct rusage *) NULL); (struct rusage *) NULL);
int oldtype = LIBC_CANCEL_ASYNC ();
pid_t result = INLINE_SYSCALL (wait4, 4, WAIT_ANY, stat_loc, 0,
(struct rusage *) NULL);
LIBC_CANCEL_RESET (oldtype);
return result; return result;
} }

View File

@ -19,15 +19,14 @@
#include <stddef.h> #include <stddef.h>
#include <errno.h> #include <errno.h>
#include <sys/wait.h> #include <sys/wait.h>
#include <sysdep.h> #include <sysdep-cancel.h>
static inline int int
do_waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options) __waitid (idtype_t idtype, id_t id, siginfo_t *infop, int options)
{ {
/* The unused fifth argument is a `struct rusage *' that we could /* The unused fifth argument is a `struct rusage *' that we could
pass if we were using waitid to simulate wait3/wait4. */ 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 weak_alias (__waitid, waitid)
strong_alias (__waitid, __libc_waitid)
#include "sysdeps/posix/waitid.c"

View File

@ -23,26 +23,11 @@
__pid_t __pid_t
__waitpid (__pid_t pid, int *stat_loc, int options) __waitpid (__pid_t pid, int *stat_loc, int options)
{ {
if (SINGLE_THREAD_P)
{
#ifdef __NR_waitpid #ifdef __NR_waitpid
return INLINE_SYSCALL (waitpid, 3, pid, stat_loc, options); return SYSCALL_CANCEL (waitpid, pid, stat_loc, options);
#else #else
return INLINE_SYSCALL (wait4, 4, pid, stat_loc, options, NULL); return SYSCALL_CANCEL (wait4, pid, stat_loc, options, NULL);
#endif #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) libc_hidden_def (__waitpid)
weak_alias (__waitpid, waitpid) weak_alias (__waitpid, waitpid)

View File

@ -25,17 +25,7 @@ int
fallocate (int fd, int mode, __off_t offset, __off_t len) fallocate (int fd, int mode, __off_t offset, __off_t len)
{ {
#ifdef __NR_fallocate #ifdef __NR_fallocate
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (fallocate, fd, mode, offset, len);
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;
#else #else
__set_errno (ENOSYS); __set_errno (ENOSYS);
return -1; return -1;

View File

@ -38,16 +38,7 @@ preadv (int fd, const struct iovec *vector, int count, off_t offset)
#ifdef __NR_preadv #ifdef __NR_preadv
ssize_t result; ssize_t result;
if (SINGLE_THREAD_P) result = SYSCALL_CANCEL (preadv, fd, vector, count, offset);
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);
}
# ifdef __ASSUME_PREADV # ifdef __ASSUME_PREADV
return result; return result;
# endif # endif

View File

@ -38,16 +38,7 @@ pwritev (int fd, const struct iovec *vector, int count, off_t offset)
#ifdef __NR_pwritev #ifdef __NR_pwritev
ssize_t result; ssize_t result;
if (SINGLE_THREAD_P) result = SYSCALL_CANCEL (pwritev, fd, vector, count, offset);
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);
}
# ifdef __ASSUME_PWRITEV # ifdef __ASSUME_PWRITEV
return result; return result;
# endif # endif

View File

@ -25,16 +25,7 @@
ssize_t ssize_t
__libc_recv (int fd, void *buf, size_t n, int flags) __libc_recv (int fd, void *buf, size_t n, int flags)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (recvfrom, fd, buf, n, flags, NULL, NULL);
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;
} }
weak_alias (__libc_recv, __recv) weak_alias (__libc_recv, __recv)

View File

@ -23,17 +23,7 @@
ssize_t ssize_t
__libc_send (int fd, const void *buf, size_t n, int flags) __libc_send (int fd, const void *buf, size_t n, int flags)
{ {
if (SINGLE_THREAD_P) return SYSCALL_CANCEL (sendto, fd, buf, n, flags, NULL, (size_t) 0);
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;
} }
weak_alias (__libc_send, __send) weak_alias (__libc_send, __send)