From bc2eb9321ec0d17d41596933617b2522c9aa5e0b Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Wed, 29 Jan 2020 20:38:36 +0000 Subject: linux: Remove INTERNAL_SYSCALL_DECL With all Linux ABIs using the expected Linux kABI to indicate syscalls errors, the INTERNAL_SYSCALL_DECL is an empty declaration on all ports. This patch removes the 'err' argument on INTERNAL_SYSCALL* macro and remove the INTERNAL_SYSCALL_DECL usage. Checked with a build against all affected ABIs. --- sysdeps/unix/sysv/linux/aarch64/sysdep.h | 14 +++--- sysdeps/unix/sysv/linux/aio_misc.h | 9 ++-- sysdeps/unix/sysv/linux/alpha/fxstat.c | 13 +++-- sysdeps/unix/sysv/linux/alpha/fxstatat.c | 7 ++- sysdeps/unix/sysv/linux/alpha/lxstat.c | 13 +++-- sysdeps/unix/sysv/linux/alpha/sysdep.h | 4 +- sysdeps/unix/sysv/linux/alpha/xstat.c | 13 +++-- sysdeps/unix/sysv/linux/arm/dl-machine.h | 2 +- sysdeps/unix/sysv/linux/arm/sysdep.h | 12 ++--- sysdeps/unix/sysv/linux/arm/tls.h | 7 ++- sysdeps/unix/sysv/linux/clock_getcpuclockid.c | 9 ++-- sysdeps/unix/sysv/linux/clock_nanosleep.c | 22 ++++---- sysdeps/unix/sysv/linux/createthread.c | 19 +++---- sysdeps/unix/sysv/linux/csky/sysdep.h | 24 ++++----- sysdeps/unix/sysv/linux/default-sched.h | 6 +-- sysdeps/unix/sysv/linux/dl-origin.c | 7 ++- sysdeps/unix/sysv/linux/dl-writev.h | 3 +- sysdeps/unix/sysv/linux/exit-thread.h | 3 +- sysdeps/unix/sysv/linux/fcntl_nocancel.c | 7 ++- sysdeps/unix/sysv/linux/fxstatat.c | 9 ++-- sysdeps/unix/sysv/linux/fxstatat64.c | 13 ++--- sysdeps/unix/sysv/linux/generic/____longjmp_chk.c | 3 +- sysdeps/unix/sysv/linux/generic/brk.c | 4 +- sysdeps/unix/sysv/linux/generic/dl-origin.c | 7 ++- sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c | 5 +- sysdeps/unix/sysv/linux/hppa/sysdep.h | 4 +- sysdeps/unix/sysv/linux/i386/brk.c | 3 +- sysdeps/unix/sysv/linux/i386/fxstat.c | 8 ++- sysdeps/unix/sysv/linux/i386/fxstatat.c | 8 ++- sysdeps/unix/sysv/linux/i386/lxstat.c | 8 ++- sysdeps/unix/sysv/linux/i386/sysdep.h | 58 +++++++++++----------- sysdeps/unix/sysv/linux/i386/xstat.c | 8 ++- sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c | 3 +- sysdeps/unix/sysv/linux/ia64/sysdep.h | 8 +-- sysdeps/unix/sysv/linux/ifaddrs.c | 3 +- sysdeps/unix/sysv/linux/internal-signals.h | 9 ++-- sysdeps/unix/sysv/linux/libc_fatal.c | 7 ++- sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c | 5 +- sysdeps/unix/sysv/linux/m68k/brk.c | 3 +- .../unix/sysv/linux/m68k/coldfire/atomic-machine.h | 2 +- sysdeps/unix/sysv/linux/m68k/getpagesize.c | 5 +- sysdeps/unix/sysv/linux/m68k/m68k-helpers.c | 3 +- sysdeps/unix/sysv/linux/m68k/sysdep.h | 6 +-- sysdeps/unix/sysv/linux/microblaze/brk.c | 4 +- sysdeps/unix/sysv/linux/microblaze/sysdep.h | 4 +- sysdeps/unix/sysv/linux/mips/brk.c | 3 +- sysdeps/unix/sysv/linux/mips/mips32/sysdep.h | 10 ++-- sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c | 7 ++- sysdeps/unix/sysv/linux/mips/mips64/sysdep.h | 29 ++++++----- sysdeps/unix/sysv/linux/mq_unlink.c | 7 ++- sysdeps/unix/sysv/linux/nios2/sysdep.h | 10 ++-- sysdeps/unix/sysv/linux/not-cancel.h | 3 +- sysdeps/unix/sysv/linux/not-errno.h | 16 +++--- sysdeps/unix/sysv/linux/nscd_setup_thread.c | 7 ++- sysdeps/unix/sysv/linux/personality.c | 7 ++- sysdeps/unix/sysv/linux/posix_fadvise.c | 11 ++-- sysdeps/unix/sysv/linux/posix_fadvise64.c | 9 ++-- sysdeps/unix/sysv/linux/posix_fallocate.c | 9 ++-- sysdeps/unix/sysv/linux/posix_fallocate64.c | 15 ++---- sysdeps/unix/sysv/linux/posix_madvise.c | 5 +- .../unix/sysv/linux/powerpc/get_timebase_freq.c | 3 +- .../sysv/linux/powerpc/powerpc32/fpu/fe_mask.c | 3 +- .../sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c | 3 +- .../sysv/linux/powerpc/powerpc64/fpu/fe_mask.c | 3 +- .../sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c | 3 +- sysdeps/unix/sysv/linux/powerpc/sysdep.h | 12 ++--- sysdeps/unix/sysv/linux/pthread-pids.h | 3 +- sysdeps/unix/sysv/linux/pthread_getaffinity.c | 9 ++-- sysdeps/unix/sysv/linux/pthread_kill.c | 8 ++- sysdeps/unix/sysv/linux/pthread_setaffinity.c | 11 ++-- sysdeps/unix/sysv/linux/pthread_sigqueue.c | 8 ++- sysdeps/unix/sysv/linux/raise.c | 7 ++- sysdeps/unix/sysv/linux/riscv/syscall.c | 5 +- sysdeps/unix/sysv/linux/riscv/sysdep.h | 24 ++++----- .../unix/sysv/linux/s390/s390-32/____longjmp_chk.c | 5 +- .../unix/sysv/linux/s390/s390-32/posix_fadvise64.c | 7 ++- sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h | 4 ++ .../unix/sysv/linux/s390/s390-64/____longjmp_chk.c | 5 +- sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h | 4 ++ sysdeps/unix/sysv/linux/s390/sysdep.h | 6 +-- sysdeps/unix/sysv/linux/safe-fatal.h | 5 +- sysdeps/unix/sysv/linux/sh/sysdep.h | 4 +- sysdeps/unix/sysv/linux/shmat.c | 8 ++- sysdeps/unix/sysv/linux/sparc/sysdep.h | 22 ++++---- sysdeps/unix/sysv/linux/sysdep-vdso.h | 15 +++--- sysdeps/unix/sysv/linux/sysdep.h | 14 ++---- sysdeps/unix/sysv/linux/timer_create.c | 9 ++-- sysdeps/unix/sysv/linux/timer_routines.c | 9 ++-- sysdeps/unix/sysv/linux/times.c | 7 ++- sysdeps/unix/sysv/linux/x86/cpu-features.c | 4 +- sysdeps/unix/sysv/linux/x86/dl-cet.h | 17 +++---- sysdeps/unix/sysv/linux/x86_64/sysdep.h | 24 +++++---- sysdeps/unix/sysv/linux/x86_64/x32/times.c | 4 +- 93 files changed, 360 insertions(+), 457 deletions(-) (limited to 'sysdeps/unix/sysv') diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h index 79fa0bd..319a7c7 100644 --- a/sysdeps/unix/sysv/linux/aarch64/sysdep.h +++ b/sysdeps/unix/sysv/linux/aarch64/sysdep.h @@ -171,7 +171,7 @@ # define SINGLE_THREAD_BY_GLOBAL 1 # undef INTERNAL_SYSCALL_RAW -# define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_RAW(name, nr, args...) \ ({ long _sys_result; \ { \ LOAD_ARGS_##nr (args) \ @@ -183,12 +183,12 @@ _sys_result; }) # undef INTERNAL_SYSCALL -# define INTERNAL_SYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args) +# define INTERNAL_SYSCALL(name, nr, args...) \ + INTERNAL_SYSCALL_RAW(SYS_ify(name), nr, args) # undef INTERNAL_SYSCALL_AARCH64 -# define INTERNAL_SYSCALL_AARCH64(name, err, nr, args...) \ - INTERNAL_SYSCALL_RAW(__ARM_NR_##name, err, nr, args) +# define INTERNAL_SYSCALL_AARCH64(name, nr, args...) \ + INTERNAL_SYSCALL_RAW(__ARM_NR_##name, nr, args) # define LOAD_ARGS_0() \ register long _x0 asm ("x0"); @@ -231,8 +231,8 @@ # define ASM_ARGS_7 ASM_ARGS_6, "r" (_x6) # undef INTERNAL_SYSCALL_NCS -# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ - INTERNAL_SYSCALL_RAW (number, err, nr, args) +# define INTERNAL_SYSCALL_NCS(number, nr, args...) \ + INTERNAL_SYSCALL_RAW (number, nr, args) #endif /* __ASSEMBLER__ */ diff --git a/sysdeps/unix/sysv/linux/aio_misc.h b/sysdeps/unix/sysv/linux/aio_misc.h index 42849ab7..30c3cd7 100644 --- a/sysdeps/unix/sysv/linux/aio_misc.h +++ b/sysdeps/unix/sysv/linux/aio_misc.h @@ -31,8 +31,7 @@ __aio_start_notify_thread (void) { sigset_t ss; sigemptyset (&ss); - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, &ss, NULL, _NSIG / 8); + INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_SETMASK, &ss, NULL, _NSIG / 8); } extern inline int @@ -53,14 +52,12 @@ __aio_create_helper_thread (pthread_t *threadp, void *(*tf) (void *), sigset_t ss; sigset_t oss; sigfillset (&ss); - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, &ss, &oss, _NSIG / 8); + INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_SETMASK, &ss, &oss, _NSIG / 8); int ret = pthread_create (threadp, &attr, tf, arg); /* Restore the signal mask. */ - INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, &oss, NULL, - _NSIG / 8); + INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_SETMASK, &oss, NULL, _NSIG / 8); (void) pthread_attr_destroy (&attr); return ret; diff --git a/sysdeps/unix/sysv/linux/alpha/fxstat.c b/sysdeps/unix/sysv/linux/alpha/fxstat.c index d10e0ac..0978610 100644 --- a/sysdeps/unix/sysv/linux/alpha/fxstat.c +++ b/sysdeps/unix/sysv/linux/alpha/fxstat.c @@ -33,23 +33,22 @@ int __fxstat (int vers, int fd, struct stat *buf) { - INTERNAL_SYSCALL_DECL (err); int result; struct kernel_stat kbuf; if (vers == _STAT_VER_KERNEL64) { - result = INTERNAL_SYSCALL (fstat64, err, 2, fd, buf); - if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + result = INTERNAL_SYSCALL_CALL (fstat64, fd, buf); + if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result))) return result; - __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + __set_errno (INTERNAL_SYSCALL_ERRNO (result)); return -1; } - result = INTERNAL_SYSCALL (fstat, err, 2, fd, &kbuf); - if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + result = INTERNAL_SYSCALL_CALL (fstat, fd, &kbuf); + if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result))) return __xstat_conv (vers, &kbuf, buf); - __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + __set_errno (INTERNAL_SYSCALL_ERRNO (result)); return -1; } hidden_def (__fxstat) diff --git a/sysdeps/unix/sysv/linux/alpha/fxstatat.c b/sysdeps/unix/sysv/linux/alpha/fxstatat.c index 4d2815a..c5953d2 100644 --- a/sysdeps/unix/sysv/linux/alpha/fxstatat.c +++ b/sysdeps/unix/sysv/linux/alpha/fxstatat.c @@ -33,7 +33,6 @@ int __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag) { - INTERNAL_SYSCALL_DECL (err); int result, errno_out; /* ??? The __fxstatat entry point is new enough that it must be using @@ -41,10 +40,10 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag) cannot actually check this, lest the compiler not optimize the rest of the function away. */ - result = INTERNAL_SYSCALL (fstatat64, err, 4, fd, file, st, flag); - if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + result = INTERNAL_SYSCALL_CALL (fstatat64, fd, file, st, flag); + if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result))) return result; - errno_out = INTERNAL_SYSCALL_ERRNO (result, err); + errno_out = INTERNAL_SYSCALL_ERRNO (result); __set_errno (errno_out); return -1; } diff --git a/sysdeps/unix/sysv/linux/alpha/lxstat.c b/sysdeps/unix/sysv/linux/alpha/lxstat.c index bb2baf0..eb03a5f 100644 --- a/sysdeps/unix/sysv/linux/alpha/lxstat.c +++ b/sysdeps/unix/sysv/linux/alpha/lxstat.c @@ -33,23 +33,22 @@ int __lxstat (int vers, const char *name, struct stat *buf) { - INTERNAL_SYSCALL_DECL (err); int result; struct kernel_stat kbuf; if (vers == _STAT_VER_KERNEL64) { - result = INTERNAL_SYSCALL (lstat64, err, 2, name, buf); - if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + result = INTERNAL_SYSCALL_CALL (lstat64, name, buf); + if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result))) return result; - __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + __set_errno (INTERNAL_SYSCALL_ERRNO (result)); return -1; } - result = INTERNAL_SYSCALL (lstat, err, 2, name, &kbuf); - if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + result = INTERNAL_SYSCALL_CALL (lstat, name, &kbuf); + if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result))) return __xstat_conv (vers, &kbuf, buf); - __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + __set_errno (INTERNAL_SYSCALL_ERRNO (result)); return -1; } hidden_def (__lxstat) diff --git a/sysdeps/unix/sysv/linux/alpha/sysdep.h b/sysdeps/unix/sysv/linux/alpha/sysdep.h index f5bcd85..7daf445 100644 --- a/sysdeps/unix/sysv/linux/alpha/sysdep.h +++ b/sysdeps/unix/sysv/linux/alpha/sysdep.h @@ -170,10 +170,10 @@ __LABEL(name) \ #else /* !ASSEMBLER */ -#define INTERNAL_SYSCALL(name, err_out, nr, args...) \ +#define INTERNAL_SYSCALL(name, nr, args...) \ internal_syscall##nr(__NR_##name, args) -#define INTERNAL_SYSCALL_NCS(name, err_out, nr, args...) \ +#define INTERNAL_SYSCALL_NCS(name, nr, args...) \ internal_syscall##nr(name, args) /* The normal Alpha calling convention sign-extends 32-bit quantties diff --git a/sysdeps/unix/sysv/linux/alpha/xstat.c b/sysdeps/unix/sysv/linux/alpha/xstat.c index aa45c7d..3ba1ae1 100644 --- a/sysdeps/unix/sysv/linux/alpha/xstat.c +++ b/sysdeps/unix/sysv/linux/alpha/xstat.c @@ -33,23 +33,22 @@ int __xstat (int vers, const char *name, struct stat *buf) { - INTERNAL_SYSCALL_DECL (err); int result; struct kernel_stat kbuf; if (vers == _STAT_VER_KERNEL64) { - result = INTERNAL_SYSCALL (stat64, err, 2, name, buf); - if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + result = INTERNAL_SYSCALL_CALL (stat64, name, buf); + if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result))) return result; - __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + __set_errno (INTERNAL_SYSCALL_ERRNO (result)); return -1; } - result = INTERNAL_SYSCALL (stat, err, 2, name, &kbuf); - if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + result = INTERNAL_SYSCALL_CALL (stat, name, &kbuf); + if (__glibc_likely (!INTERNAL_SYSCALL_ERROR_P (result))) return __xstat_conv (vers, &kbuf, buf); - __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + __set_errno (INTERNAL_SYSCALL_ERRNO (result)); return -1; } hidden_def (__xstat) diff --git a/sysdeps/unix/sysv/linux/arm/dl-machine.h b/sysdeps/unix/sysv/linux/arm/dl-machine.h index 5fc685f..a307326 100644 --- a/sysdeps/unix/sysv/linux/arm/dl-machine.h +++ b/sysdeps/unix/sysv/linux/arm/dl-machine.h @@ -20,7 +20,7 @@ /* This definition is Linux-specific. */ #define CLEAR_CACHE(BEG,END) \ - INTERNAL_SYSCALL (cacheflush, , 3, (BEG), (END), 0) + INTERNAL_SYSCALL_CALL (cacheflush, (BEG), (END), 0) #endif diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h index f6e6b63..e2985cf 100644 --- a/sysdeps/unix/sysv/linux/arm/sysdep.h +++ b/sysdeps/unix/sysv/linux/arm/sysdep.h @@ -328,7 +328,7 @@ __local_syscall_error: \ then unwinding will fail higher up the stack. So we move the syscall out of line and provide its own unwind information. */ # undef INTERNAL_SYSCALL_RAW -# define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_RAW(name, nr, args...) \ ({ \ register int _a1 asm ("a1"); \ int _nametmp = name; \ @@ -341,7 +341,7 @@ __local_syscall_error: \ _a1; }) #else /* ARM */ # undef INTERNAL_SYSCALL_RAW -# define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_RAW(name, nr, args...) \ ({ \ register int _a1 asm ("r0"), _nr asm ("r7"); \ LOAD_ARGS_##nr (args) \ @@ -354,8 +354,8 @@ __local_syscall_error: \ #endif #undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args) +#define INTERNAL_SYSCALL(name, nr, args...) \ + INTERNAL_SYSCALL_RAW(SYS_ify(name), nr, args) #define VDSO_NAME "LINUX_2.6" #define VDSO_HASH 61765110 @@ -407,8 +407,8 @@ __local_syscall_error: \ /* For EABI, non-constant syscalls are actually pretty easy... */ #undef INTERNAL_SYSCALL_NCS -#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ - INTERNAL_SYSCALL_RAW (number, err, nr, args) +#define INTERNAL_SYSCALL_NCS(number, nr, args...) \ + INTERNAL_SYSCALL_RAW (number, nr, args) #define SINGLE_THREAD_BY_GLOBAL 1 diff --git a/sysdeps/unix/sysv/linux/arm/tls.h b/sysdeps/unix/sysv/linux/arm/tls.h index 18afe24..1b520c6 100644 --- a/sysdeps/unix/sysv/linux/arm/tls.h +++ b/sysdeps/unix/sysv/linux/arm/tls.h @@ -31,10 +31,9 @@ special attention since 'errno' is not yet available and if the operation can cause a failure 'errno' must not be touched. */ # define TLS_INIT_TP(tcbp) \ - ({ INTERNAL_SYSCALL_DECL (err); \ - long int result_var; \ - result_var = INTERNAL_SYSCALL (set_tls, err, 1, (tcbp)); \ - INTERNAL_SYSCALL_ERROR_P (result_var, err) \ + ({ long int result_var; \ + result_var = INTERNAL_SYSCALL_CALL (set_tls, 1, (tcbp)); \ + INTERNAL_SYSCALL_ERROR_P (result_var) \ ? "unknown error" : NULL; }) #endif /* __ASSEMBLER__ */ diff --git a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c index 97fa9cc..be1f477 100644 --- a/sysdeps/unix/sysv/linux/clock_getcpuclockid.c +++ b/sysdeps/unix/sysv/linux/clock_getcpuclockid.c @@ -30,21 +30,20 @@ __clock_getcpuclockid (pid_t pid, clockid_t *clock_id) const clockid_t pidclock = MAKE_PROCESS_CPUCLOCK (pid, CPUCLOCK_SCHED); - INTERNAL_SYSCALL_DECL (err); - int r = INTERNAL_SYSCALL (clock_getres, err, 2, pidclock, NULL); - if (!INTERNAL_SYSCALL_ERROR_P (r, err)) + int r = INTERNAL_SYSCALL_CALL (clock_getres, pidclock, NULL); + if (!INTERNAL_SYSCALL_ERROR_P (r)) { *clock_id = pidclock; return 0; } - if (INTERNAL_SYSCALL_ERRNO (r, err) == EINVAL) + if (INTERNAL_SYSCALL_ERRNO (r) == EINVAL) { /* The clock_getres system call checked the PID for us. */ return ESRCH; } else - return INTERNAL_SYSCALL_ERRNO (r, err); + return INTERNAL_SYSCALL_ERRNO (r); } versioned_symbol (libc, __clock_getcpuclockid, clock_getcpuclockid, GLIBC_2_17); diff --git a/sysdeps/unix/sysv/linux/clock_nanosleep.c b/sysdeps/unix/sysv/linux/clock_nanosleep.c index 728137a..48175ef 100644 --- a/sysdeps/unix/sysv/linux/clock_nanosleep.c +++ b/sysdeps/unix/sysv/linux/clock_nanosleep.c @@ -39,23 +39,21 @@ __clock_nanosleep_time64 (clockid_t clock_id, int flags, const struct __timespec /* If the call is interrupted by a signal handler or encounters an error, it returns a positive value similar to errno. */ - INTERNAL_SYSCALL_DECL (err); - #ifdef __ASSUME_TIME64_SYSCALLS # ifndef __NR_clock_nanosleep_time64 # define __NR_clock_nanosleep_time64 __NR_clock_nanosleep # endif - r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, clock_id, + r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, clock_id, flags, req, rem); #else # ifdef __NR_clock_nanosleep_time64 - r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, err, clock_id, + r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep_time64, clock_id, flags, req, rem); - if (! INTERNAL_SYSCALL_ERROR_P (r, err)) + if (! INTERNAL_SYSCALL_ERROR_P (r)) return 0; - if (INTERNAL_SYSCALL_ERRNO (r, err) != ENOSYS) - return INTERNAL_SYSCALL_ERRNO (r, err); + if (INTERNAL_SYSCALL_ERRNO (r) != ENOSYS) + return INTERNAL_SYSCALL_ERRNO (r); # endif /* __NR_clock_nanosleep_time64 */ if (! in_time_t_range (req->tv_sec)) @@ -66,18 +64,18 @@ __clock_nanosleep_time64 (clockid_t clock_id, int flags, const struct __timespec struct timespec tr32; struct timespec ts32 = valid_timespec64_to_timespec (*req); - r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep, err, clock_id, flags, + r = INTERNAL_SYSCALL_CANCEL (clock_nanosleep, clock_id, flags, &ts32, &tr32); - if (INTERNAL_SYSCALL_ERROR_P (r, err)) + if (INTERNAL_SYSCALL_ERROR_P (r)) { - if (INTERNAL_SYSCALL_ERRNO (r, err) == EINTR && rem != NULL + if (INTERNAL_SYSCALL_ERRNO (r) == EINTR && rem != NULL && (flags & TIMER_ABSTIME) == 0) *rem = valid_timespec_to_timespec64 (tr32); } #endif /* __ASSUME_TIME64_SYSCALLS */ - return (INTERNAL_SYSCALL_ERROR_P (r, err) - ? INTERNAL_SYSCALL_ERRNO (r, err) : 0); + return (INTERNAL_SYSCALL_ERROR_P (r) + ? INTERNAL_SYSCALL_ERRNO (r) : 0); } #if __TIMESIZE != 64 diff --git a/sysdeps/unix/sysv/linux/createthread.c b/sysdeps/unix/sysv/linux/createthread.c index 33e5f5d..21f9d24 100644 --- a/sysdeps/unix/sysv/linux/createthread.c +++ b/sysdeps/unix/sysv/linux/createthread.c @@ -110,7 +110,6 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr, /* Now we have the possibility to set scheduling parameters etc. */ if (attr != NULL) { - INTERNAL_SYSCALL_DECL (err); int res; /* Set the affinity mask if necessary. */ @@ -118,21 +117,19 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr, { assert (*stopped_start); - res = INTERNAL_SYSCALL (sched_setaffinity, err, 3, pd->tid, - attr->cpusetsize, attr->cpuset); + res = INTERNAL_SYSCALL_CALL (sched_setaffinity, pd->tid, + attr->cpusetsize, attr->cpuset); - if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res, err))) + if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res))) err_out: { /* The operation failed. We have to kill the thread. We let the normal cancellation mechanism do the work. */ pid_t pid = __getpid (); - INTERNAL_SYSCALL_DECL (err2); - (void) INTERNAL_SYSCALL_CALL (tgkill, err2, pid, pd->tid, - SIGCANCEL); + INTERNAL_SYSCALL_CALL (tgkill, pid, pd->tid, SIGCANCEL); - return INTERNAL_SYSCALL_ERRNO (res, err); + return INTERNAL_SYSCALL_ERRNO (res); } } @@ -141,10 +138,10 @@ create_thread (struct pthread *pd, const struct pthread_attr *attr, { assert (*stopped_start); - res = INTERNAL_SYSCALL (sched_setscheduler, err, 3, pd->tid, - pd->schedpolicy, &pd->schedparam); + res = INTERNAL_SYSCALL_CALL (sched_setscheduler, pd->tid, + pd->schedpolicy, &pd->schedparam); - if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res, err))) + if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (res))) goto err_out; } } diff --git a/sysdeps/unix/sysv/linux/csky/sysdep.h b/sysdeps/unix/sysv/linux/csky/sysdep.h index 7ebb19d..7e8e89d 100644 --- a/sysdeps/unix/sysv/linux/csky/sysdep.h +++ b/sysdeps/unix/sysv/linux/csky/sysdep.h @@ -294,7 +294,7 @@ __local_syscall_error: \ #else /* not __ASSEMBLER__ */ # undef INTERNAL_SYSCALL_RAW -# define INTERNAL_SYSCALL_RAW0(name, err, dummy...) \ +# define INTERNAL_SYSCALL_RAW0(name, dummy...) \ ({unsigned int __sys_result; \ { \ register int _a1 __asm__ ("a0"), _nr __asm__ ("r7"); \ @@ -307,7 +307,7 @@ __local_syscall_error: \ } \ (int) __sys_result; }) -# define INTERNAL_SYSCALL_RAW1(name, err, arg1) \ +# define INTERNAL_SYSCALL_RAW1(name, arg1) \ ({unsigned int __sys_result; \ register int _tmp_arg1 = (int)(arg1); \ { \ @@ -322,7 +322,7 @@ __local_syscall_error: \ } \ (int) __sys_result; }) -# define INTERNAL_SYSCALL_RAW2(name, err, arg1, arg2) \ +# define INTERNAL_SYSCALL_RAW2(name, arg1, arg2) \ ({unsigned int __sys_result; \ register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2); \ { \ @@ -338,7 +338,7 @@ __local_syscall_error: \ } \ (int) __sys_result; }) -# define INTERNAL_SYSCALL_RAW3(name, err, arg1, arg2, arg3) \ +# define INTERNAL_SYSCALL_RAW3(name, arg1, arg2, arg3) \ ({unsigned int __sys_result; \ register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2); \ register int _tmp_arg3 = (int)(arg3); \ @@ -359,7 +359,7 @@ __local_syscall_error: \ } \ (int) __sys_result; }) -# define INTERNAL_SYSCALL_RAW4(name, err, arg1, arg2, arg3, arg4) \ +# define INTERNAL_SYSCALL_RAW4(name, arg1, arg2, arg3, arg4) \ ({unsigned int __sys_result; \ register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2); \ register int _tmp_arg3 = (int)(arg3), _tmp_arg4 = (int)(arg4); \ @@ -379,7 +379,7 @@ __local_syscall_error: \ } \ (int) __sys_result; }) -# define INTERNAL_SYSCALL_RAW5(name, err, arg1, arg2, arg3, arg4, \ +# define INTERNAL_SYSCALL_RAW5(name, arg1, arg2, arg3, arg4, \ arg5) \ ({unsigned int __sys_result; \ register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2); \ @@ -402,7 +402,7 @@ __local_syscall_error: \ } \ (int) __sys_result; }) -# define INTERNAL_SYSCALL_RAW6(name, err, arg1, arg2, arg3, arg4, \ +# define INTERNAL_SYSCALL_RAW6(name, arg1, arg2, arg3, arg4, \ arg5, arg6) \ ({unsigned int __sys_result; \ register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2); \ @@ -426,7 +426,7 @@ __local_syscall_error: \ } \ (int) __sys_result; }) -# define INTERNAL_SYSCALL_RAW7(name, err, arg1, arg2, arg3, arg4, \ +# define INTERNAL_SYSCALL_RAW7(name, arg1, arg2, arg3, arg4, \ arg5, arg6, arg7) \ ({unsigned int __sys_result; \ register int _tmp_arg1 = (int)(arg1), _tmp_arg2 = (int)(arg2); \ @@ -454,12 +454,12 @@ __local_syscall_error: \ (int) __sys_result; }) # undef INTERNAL_SYSCALL -# define INTERNAL_SYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL_RAW##nr(SYS_ify(name), err, args) +# define INTERNAL_SYSCALL(name, nr, args...) \ + INTERNAL_SYSCALL_RAW##nr(SYS_ify(name), args) # undef INTERNAL_SYSCALL_NCS -# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ - INTERNAL_SYSCALL_RAW##nr (number, err, args) +# define INTERNAL_SYSCALL_NCS(number, nr, args...) \ + INTERNAL_SYSCALL_RAW##nr (number, args) #endif /* __ASSEMBLER__ */ diff --git a/sysdeps/unix/sysv/linux/default-sched.h b/sysdeps/unix/sysv/linux/default-sched.h index 26fe9ec..6db3e3b 100644 --- a/sysdeps/unix/sysv/linux/default-sched.h +++ b/sysdeps/unix/sysv/linux/default-sched.h @@ -26,17 +26,15 @@ static void collect_default_sched (struct pthread *pd) { - INTERNAL_SYSCALL_DECL (scerr); - if ((pd->flags & ATTR_FLAG_POLICY_SET) == 0) { - pd->schedpolicy = INTERNAL_SYSCALL (sched_getscheduler, scerr, 1, 0); + pd->schedpolicy = INTERNAL_SYSCALL_CALL (sched_getscheduler, 0); pd->flags |= ATTR_FLAG_POLICY_SET; } if ((pd->flags & ATTR_FLAG_SCHED_SET) == 0) { - INTERNAL_SYSCALL (sched_getparam, scerr, 2, 0, &pd->schedparam); + INTERNAL_SYSCALL_CALL (sched_getparam, 0, &pd->schedparam); pd->flags |= ATTR_FLAG_SCHED_SET; } } diff --git a/sysdeps/unix/sysv/linux/dl-origin.c b/sysdeps/unix/sysv/linux/dl-origin.c index 74c8ff1..515ed6f 100644 --- a/sysdeps/unix/sysv/linux/dl-origin.c +++ b/sysdeps/unix/sysv/linux/dl-origin.c @@ -37,11 +37,10 @@ _dl_get_origin (void) char linkval[PATH_MAX]; char *result; int len; - INTERNAL_SYSCALL_DECL (err); - len = INTERNAL_SYSCALL (readlink, err, 3, "/proc/self/exe", linkval, - sizeof (linkval)); - if (! INTERNAL_SYSCALL_ERROR_P (len, err) && len > 0 && linkval[0] != '[') + len = INTERNAL_SYSCALL_CALL (readlink, "/proc/self/exe", linkval, + sizeof (linkval)); + if (! INTERNAL_SYSCALL_ERROR_P (len) && len > 0 && linkval[0] != '[') { /* We can use this value. */ assert (linkval[0] == '/'); diff --git a/sysdeps/unix/sysv/linux/dl-writev.h b/sysdeps/unix/sysv/linux/dl-writev.h index c04d1a7..3dd8376 100644 --- a/sysdeps/unix/sysv/linux/dl-writev.h +++ b/sysdeps/unix/sysv/linux/dl-writev.h @@ -33,6 +33,5 @@ static inline void _dl_writev (int fd, const struct iovec *iov, size_t niov) { - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL (writev, err, 3, fd, iov, niov); + INTERNAL_SYSCALL_CALL (writev, fd, iov, niov); } diff --git a/sysdeps/unix/sysv/linux/exit-thread.h b/sysdeps/unix/sysv/linux/exit-thread.h index 083e462..d617594 100644 --- a/sysdeps/unix/sysv/linux/exit-thread.h +++ b/sysdeps/unix/sysv/linux/exit-thread.h @@ -32,7 +32,6 @@ __exit_thread (void) of the caller and doing unexpectedly strange things. */ while (1) { - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL (exit, err, 1, 0); + INTERNAL_SYSCALL_CALL (exit, 0); } } diff --git a/sysdeps/unix/sysv/linux/fcntl_nocancel.c b/sysdeps/unix/sysv/linux/fcntl_nocancel.c index bafc1cf..ed92110 100644 --- a/sysdeps/unix/sysv/linux/fcntl_nocancel.c +++ b/sysdeps/unix/sysv/linux/fcntl_nocancel.c @@ -51,14 +51,13 @@ __fcntl64_nocancel_adjusted (int fd, int cmd, void *arg) { if (cmd == F_GETOWN) { - INTERNAL_SYSCALL_DECL (err); struct f_owner_ex fex; - int res = INTERNAL_SYSCALL_CALL (fcntl64, err, fd, F_GETOWN_EX, &fex); - if (!INTERNAL_SYSCALL_ERROR_P (res, err)) + int res = INTERNAL_SYSCALL_CALL (fcntl64, fd, F_GETOWN_EX, &fex); + if (!INTERNAL_SYSCALL_ERROR_P (res)) return fex.type == F_OWNER_GID ? -fex.pid : fex.pid; return INLINE_SYSCALL_ERROR_RETURN_VALUE - (INTERNAL_SYSCALL_ERRNO (res, err)); + (INTERNAL_SYSCALL_ERRNO (res)); } return INLINE_SYSCALL_CALL (fcntl64, fd, cmd, (void *) arg); diff --git a/sysdeps/unix/sysv/linux/fxstatat.c b/sysdeps/unix/sysv/linux/fxstatat.c index 524d5a6..3eb898e 100644 --- a/sysdeps/unix/sysv/linux/fxstatat.c +++ b/sysdeps/unix/sysv/linux/fxstatat.c @@ -37,15 +37,14 @@ int __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag) { int result; - INTERNAL_SYSCALL_DECL (err); #ifdef STAT_IS_KERNEL_STAT # define kst (*st) #else struct kernel_stat kst; #endif - result = INTERNAL_SYSCALL (newfstatat, err, 4, fd, file, &kst, flag); - if (!__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + result = INTERNAL_SYSCALL_CALL (newfstatat, fd, file, &kst, flag); + if (!__glibc_likely (INTERNAL_SYSCALL_ERROR_P (result))) { #ifdef STAT_IS_KERNEL_STAT return 0; @@ -53,9 +52,7 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag) return __xstat_conv (vers, &kst, st); #endif } - else - return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result, - err)); + return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result)); } libc_hidden_def (__fxstatat) #if XSTAT_IS_XSTAT64 diff --git a/sysdeps/unix/sysv/linux/fxstatat64.c b/sysdeps/unix/sysv/linux/fxstatat64.c index c0f1035..e24b456 100644 --- a/sysdeps/unix/sysv/linux/fxstatat64.c +++ b/sysdeps/unix/sysv/linux/fxstatat64.c @@ -37,22 +37,19 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag) return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); int result; - INTERNAL_SYSCALL_DECL (err); #ifdef __NR_fstatat64 - result = INTERNAL_SYSCALL (fstatat64, err, 4, fd, file, st, flag); + result = INTERNAL_SYSCALL_CALL (fstatat64, fd, file, st, flag); #else struct statx tmp; - result = INTERNAL_SYSCALL (statx, err, 5, fd, file, AT_NO_AUTOMOUNT | flag, - STATX_BASIC_STATS, &tmp); + result = INTERNAL_SYSCALL_CALL (statx, fd, file, AT_NO_AUTOMOUNT | flag, + STATX_BASIC_STATS, &tmp); if (result == 0) __cp_stat64_statx (st, &tmp); #endif - if (!__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + if (!__glibc_likely (INTERNAL_SYSCALL_ERROR_P (result))) return 0; - else - return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result, - err)); + return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result)); } libc_hidden_def (__fxstatat64) diff --git a/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c b/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c index 634101a..9be49ad 100644 --- a/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c +++ b/sysdeps/unix/sysv/linux/generic/____longjmp_chk.c @@ -36,7 +36,6 @@ void ____longjmp_chk (__jmp_buf env, int val) { void *this_frame = __builtin_frame_address (0); void *saved_frame = JB_FRAME_ADDRESS (env); - INTERNAL_SYSCALL_DECL (err); stack_t ss; /* If "env" is from a frame that called us, we're all set. */ @@ -44,7 +43,7 @@ void ____longjmp_chk (__jmp_buf env, int val) __longjmp (env, val); /* If we can't get the current stack state, give up and do the longjmp. */ - if (INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &ss) != 0) + if (INTERNAL_SYSCALL_CALL (sigaltstack, NULL, &ss) != 0) __longjmp (env, val); /* If we we are executing on the alternate stack and within the diff --git a/sysdeps/unix/sysv/linux/generic/brk.c b/sysdeps/unix/sysv/linux/generic/brk.c index 2bfe5f2..40a80ab 100644 --- a/sysdeps/unix/sysv/linux/generic/brk.c +++ b/sysdeps/unix/sysv/linux/generic/brk.c @@ -31,9 +31,7 @@ weak_alias (__curbrk, ___brk_addr) int __brk (void *addr) { - INTERNAL_SYSCALL_DECL (err); - - __curbrk = (void *) INTERNAL_SYSCALL (brk, err, 1, addr); + __curbrk = (void *) INTERNAL_SYSCALL_CALL (brk, addr); if (__curbrk < addr) { __set_errno (ENOMEM); diff --git a/sysdeps/unix/sysv/linux/generic/dl-origin.c b/sysdeps/unix/sysv/linux/generic/dl-origin.c index 9d3c639..1ab02bb 100644 --- a/sysdeps/unix/sysv/linux/generic/dl-origin.c +++ b/sysdeps/unix/sysv/linux/generic/dl-origin.c @@ -38,11 +38,10 @@ _dl_get_origin (void) char linkval[PATH_MAX]; char *result; int len; - INTERNAL_SYSCALL_DECL (err); - len = INTERNAL_SYSCALL (readlinkat, err, 4, AT_FDCWD, "/proc/self/exe", - linkval, sizeof (linkval)); - if (! INTERNAL_SYSCALL_ERROR_P (len, err) && len > 0 && linkval[0] != '[') + len = INTERNAL_SYSCALL_CALL (readlinkat, AT_FDCWD, "/proc/self/exe", + linkval, sizeof (linkval)); + if (! INTERNAL_SYSCALL_ERROR_P (len) && len > 0 && linkval[0] != '[') { /* We can use this value. */ assert (linkval[0] == '/'); diff --git a/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c b/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c index d77db64..eae0a7f 100644 --- a/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c +++ b/sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c @@ -28,15 +28,14 @@ if ((unsigned long) (sp) > this_sp) \ { \ stack_t oss; \ - INTERNAL_SYSCALL_DECL (err); \ - int result = INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &oss);\ + int result = INTERNAL_SYSCALL_CALL (sigaltstack, NULL, &oss);\ /* If we aren't using an alternate stack then we have already \ shown that we are jumping to a frame that doesn't exist so \ error out. If we are using an alternate stack we must prove \ that we are jumping *out* of the alternate stack. Note that \ the check for that is the same as that for _STACK_GROWS_UP \ as for _STACK_GROWS_DOWN. */ \ - if (!INTERNAL_SYSCALL_ERROR_P (result, err) \ + if (!INTERNAL_SYSCALL_ERROR_P (result) \ && ((oss.ss_flags & SS_ONSTACK) == 0 \ || ((unsigned long) oss.ss_sp + oss.ss_size \ - (unsigned long) (sp)) < oss.ss_size)) \ diff --git a/sysdeps/unix/sysv/linux/hppa/sysdep.h b/sysdeps/unix/sysv/linux/hppa/sysdep.h index 88e368d..7f8da30 100644 --- a/sysdeps/unix/sysv/linux/hppa/sysdep.h +++ b/sysdeps/unix/sysv/linux/hppa/sysdep.h @@ -362,7 +362,7 @@ L(pre_end): ASM_LINE_SEP \ /* Similar to INLINE_SYSCALL but we don't set errno */ #undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) \ +#define INTERNAL_SYSCALL(name, nr, args...) \ ({ \ long __sys_res; \ { \ @@ -388,7 +388,7 @@ L(pre_end): ASM_LINE_SEP \ /* The _NCS variant allows non-constant syscall numbers. */ #undef INTERNAL_SYSCALL_NCS -#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +#define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ \ long __sys_res; \ { \ diff --git a/sysdeps/unix/sysv/linux/i386/brk.c b/sysdeps/unix/sysv/linux/i386/brk.c index b0e5b0f..021b6d3 100644 --- a/sysdeps/unix/sysv/linux/i386/brk.c +++ b/sysdeps/unix/sysv/linux/i386/brk.c @@ -36,8 +36,7 @@ weak_alias (__curbrk, ___brk_addr) int __brk (void *addr) { - INTERNAL_SYSCALL_DECL (err); - void *newbrk = (void *) INTERNAL_SYSCALL (brk, err, 1, addr); + void *newbrk = (void *) INTERNAL_SYSCALL_CALL (brk, addr); __curbrk = newbrk; if (newbrk < addr) return INLINE_SYSCALL_ERROR_RETURN_VALUE (ENOMEM); diff --git a/sysdeps/unix/sysv/linux/i386/fxstat.c b/sysdeps/unix/sysv/linux/i386/fxstat.c index 8eda42f..db59baa 100644 --- a/sysdeps/unix/sysv/linux/i386/fxstat.c +++ b/sysdeps/unix/sysv/linux/i386/fxstat.c @@ -42,11 +42,9 @@ __fxstat (int vers, int fd, struct stat *buf) { struct stat64 buf64; - INTERNAL_SYSCALL_DECL (err); - result = INTERNAL_SYSCALL (fstat64, err, 2, fd, &buf64); - if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err))) - return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result, - err)); + result = INTERNAL_SYSCALL_CALL (fstat64, fd, &buf64); + if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result))) + return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result)); else return __xstat32_conv (vers, &buf64, buf); } diff --git a/sysdeps/unix/sysv/linux/i386/fxstatat.c b/sysdeps/unix/sysv/linux/i386/fxstatat.c index d510d74..f720f6e 100644 --- a/sysdeps/unix/sysv/linux/i386/fxstatat.c +++ b/sysdeps/unix/sysv/linux/i386/fxstatat.c @@ -38,13 +38,11 @@ int __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag) { int result; - INTERNAL_SYSCALL_DECL (err); struct stat64 st64; - result = INTERNAL_SYSCALL (fstatat64, err, 4, fd, file, &st64, flag); - if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err))) - return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result, - err)); + result = INTERNAL_SYSCALL_CALL (fstatat64, fd, file, &st64, flag); + if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result))) + return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result)); else return __xstat32_conv (vers, &st64, st); } diff --git a/sysdeps/unix/sysv/linux/i386/lxstat.c b/sysdeps/unix/sysv/linux/i386/lxstat.c index e6f8e0f..e960077 100644 --- a/sysdeps/unix/sysv/linux/i386/lxstat.c +++ b/sysdeps/unix/sysv/linux/i386/lxstat.c @@ -43,11 +43,9 @@ __lxstat (int vers, const char *name, struct stat *buf) { struct stat64 buf64; - INTERNAL_SYSCALL_DECL (err); - result = INTERNAL_SYSCALL (lstat64, err, 2, name, &buf64); - if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err))) - return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result, - err)); + result = INTERNAL_SYSCALL_CALL (lstat64, name, &buf64); + if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result))) + return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result)); else return __xstat32_conv (vers, &buf64, buf); } diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h index 2387a4a..5e38880 100644 --- a/sysdeps/unix/sysv/linux/i386/sysdep.h +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h @@ -299,25 +299,25 @@ struct libc_do_syscall_args The _NCS variant allows non-constant syscall numbers but it is not possible to use more than four parameters. */ #undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL_MAIN_0(name, err, args...) \ - INTERNAL_SYSCALL_MAIN_INLINE(name, err, 0, args) -#define INTERNAL_SYSCALL_MAIN_1(name, err, args...) \ - INTERNAL_SYSCALL_MAIN_INLINE(name, err, 1, args) -#define INTERNAL_SYSCALL_MAIN_2(name, err, args...) \ - INTERNAL_SYSCALL_MAIN_INLINE(name, err, 2, args) -#define INTERNAL_SYSCALL_MAIN_3(name, err, args...) \ - INTERNAL_SYSCALL_MAIN_INLINE(name, err, 3, args) -#define INTERNAL_SYSCALL_MAIN_4(name, err, args...) \ - INTERNAL_SYSCALL_MAIN_INLINE(name, err, 4, args) -#define INTERNAL_SYSCALL_MAIN_5(name, err, args...) \ - INTERNAL_SYSCALL_MAIN_INLINE(name, err, 5, args) +#define INTERNAL_SYSCALL_MAIN_0(name, args...) \ + INTERNAL_SYSCALL_MAIN_INLINE(name, 0, args) +#define INTERNAL_SYSCALL_MAIN_1(name, args...) \ + INTERNAL_SYSCALL_MAIN_INLINE(name, 1, args) +#define INTERNAL_SYSCALL_MAIN_2(name, args...) \ + INTERNAL_SYSCALL_MAIN_INLINE(name, 2, args) +#define INTERNAL_SYSCALL_MAIN_3(name, args...) \ + INTERNAL_SYSCALL_MAIN_INLINE(name, 3, args) +#define INTERNAL_SYSCALL_MAIN_4(name, args...) \ + INTERNAL_SYSCALL_MAIN_INLINE(name, 4, args) +#define INTERNAL_SYSCALL_MAIN_5(name, args...) \ + INTERNAL_SYSCALL_MAIN_INLINE(name, 5, args) /* Each object using 6-argument inline syscalls must include a definition of __libc_do_syscall. */ #ifdef OPTIMIZE_FOR_GCC_5 -# define INTERNAL_SYSCALL_MAIN_6(name, err, args...) \ - INTERNAL_SYSCALL_MAIN_INLINE(name, err, 6, args) +# define INTERNAL_SYSCALL_MAIN_6(name, args...) \ + INTERNAL_SYSCALL_MAIN_INLINE(name, 6, args) #else /* GCC 5 */ -# define INTERNAL_SYSCALL_MAIN_6(name, err, arg1, arg2, arg3, \ +# define INTERNAL_SYSCALL_MAIN_6(name, arg1, arg2, arg3, \ arg4, arg5, arg6) \ struct libc_do_syscall_args _xv = \ { \ @@ -332,22 +332,22 @@ struct libc_do_syscall_args : "i" (__NR_##name), "c" (arg2), "d" (arg3), "S" (arg4), "D" (&_xv) \ : "memory", "cc") #endif /* GCC 5 */ -#define INTERNAL_SYSCALL(name, err, nr, args...) \ +#define INTERNAL_SYSCALL(name, nr, args...) \ ({ \ register unsigned int resultvar; \ - INTERNAL_SYSCALL_MAIN_##nr (name, err, args); \ + INTERNAL_SYSCALL_MAIN_##nr (name, args); \ (int) resultvar; }) #if I386_USE_SYSENTER # ifdef OPTIMIZE_FOR_GCC_5 # ifdef PIC -# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ LOADREGS_##nr(args) \ asm volatile ( \ "call *%%gs:%P2" \ : "=a" (resultvar) \ : "a" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo)) \ ASMARGS_##nr(args) : "memory", "cc") -# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ \ register unsigned int resultvar; \ LOADREGS_##nr(args) \ @@ -358,13 +358,13 @@ struct libc_do_syscall_args ASMARGS_##nr(args) : "memory", "cc"); \ (int) resultvar; }) # else -# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ LOADREGS_##nr(args) \ asm volatile ( \ "call *_dl_sysinfo" \ : "=a" (resultvar) \ : "a" (__NR_##name) ASMARGS_##nr(args) : "memory", "cc") -# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ \ register unsigned int resultvar; \ LOADREGS_##nr(args) \ @@ -376,7 +376,7 @@ struct libc_do_syscall_args # endif # else /* GCC 5 */ # ifdef PIC -# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ EXTRAVAR_##nr \ asm volatile ( \ LOADARGS_##nr \ @@ -386,7 +386,7 @@ struct libc_do_syscall_args : "=a" (resultvar) \ : "i" (__NR_##name), "i" (offsetof (tcbhead_t, sysinfo)) \ ASMFMT_##nr(args) : "memory", "cc") -# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ \ register unsigned int resultvar; \ EXTRAVAR_##nr \ @@ -399,7 +399,7 @@ struct libc_do_syscall_args ASMFMT_##nr(args) : "memory", "cc"); \ (int) resultvar; }) # else -# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ EXTRAVAR_##nr \ asm volatile ( \ LOADARGS_##nr \ @@ -408,7 +408,7 @@ struct libc_do_syscall_args RESTOREARGS_##nr \ : "=a" (resultvar) \ : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc") -# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ \ register unsigned int resultvar; \ EXTRAVAR_##nr \ @@ -423,13 +423,13 @@ struct libc_do_syscall_args # endif /* GCC 5 */ #else # ifdef OPTIMIZE_FOR_GCC_5 -# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ LOADREGS_##nr(args) \ asm volatile ( \ "int $0x80" \ : "=a" (resultvar) \ : "a" (__NR_##name) ASMARGS_##nr(args) : "memory", "cc") -# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ \ register unsigned int resultvar; \ LOADREGS_##nr(args) \ @@ -439,7 +439,7 @@ struct libc_do_syscall_args : "a" (name) ASMARGS_##nr(args) : "memory", "cc"); \ (int) resultvar; }) # else /* GCC 5 */ -# define INTERNAL_SYSCALL_MAIN_INLINE(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_MAIN_INLINE(name, nr, args...) \ EXTRAVAR_##nr \ asm volatile ( \ LOADARGS_##nr \ @@ -448,7 +448,7 @@ struct libc_do_syscall_args RESTOREARGS_##nr \ : "=a" (resultvar) \ : "i" (__NR_##name) ASMFMT_##nr(args) : "memory", "cc") -# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ \ register unsigned int resultvar; \ EXTRAVAR_##nr \ diff --git a/sysdeps/unix/sysv/linux/i386/xstat.c b/sysdeps/unix/sysv/linux/i386/xstat.c index 3557a91..96f6716 100644 --- a/sysdeps/unix/sysv/linux/i386/xstat.c +++ b/sysdeps/unix/sysv/linux/i386/xstat.c @@ -43,11 +43,9 @@ __xstat (int vers, const char *name, struct stat *buf) { struct stat64 buf64; - INTERNAL_SYSCALL_DECL (err); - result = INTERNAL_SYSCALL (stat64, err, 2, name, &buf64); - if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err))) - return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result, - err)); + result = INTERNAL_SYSCALL_CALL (stat64, name, &buf64); + if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result))) + return INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (result)); else return __xstat32_conv (vers, &buf64, buf); } diff --git a/sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c b/sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c index 85a8714..6e16651 100644 --- a/sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c +++ b/sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c @@ -112,8 +112,7 @@ __sigstack_longjmp (__jmp_buf buf, int val) jb_sp = ((unsigned long *) buf)[JB_SP]; jb_bsp = ((unsigned long **) buf)[JB_BSP]; - INTERNAL_SYSCALL_DECL (err); - (void) INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &stk); + INTERNAL_SYSCALL_CALL (sigaltstack, NULL, &stk); ss_sp = (unsigned long) stk.ss_sp; jb_rnat_addr = ia64_rse_rnat_addr (jb_bsp); diff --git a/sysdeps/unix/sysv/linux/ia64/sysdep.h b/sysdeps/unix/sysv/linux/ia64/sysdep.h index 8b2ff9c..ed279af 100644 --- a/sysdeps/unix/sysv/linux/ia64/sysdep.h +++ b/sysdeps/unix/sysv/linux/ia64/sysdep.h @@ -192,7 +192,7 @@ #ifdef IA64_USE_NEW_STUB -# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ \ LOAD_ARGS_##nr (args) \ register long _r8 __asm ("r8"); \ @@ -215,7 +215,7 @@ #else /* !IA64_USE_NEW_STUB */ -# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ \ LOAD_ARGS_##nr (args) \ register long _r8 asm ("r8"); \ @@ -232,8 +232,8 @@ #endif /* !IA64_USE_NEW_STUB */ -#define INTERNAL_SYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) +#define INTERNAL_SYSCALL(name, nr, args...) \ + INTERNAL_SYSCALL_NCS (__NR_##name, nr, ##args) #define LOAD_ARGS_0() #define LOAD_REGS_0 diff --git a/sysdeps/unix/sysv/linux/ifaddrs.c b/sysdeps/unix/sysv/linux/ifaddrs.c index ccacbfd..8ab73a7 100644 --- a/sysdeps/unix/sysv/linux/ifaddrs.c +++ b/sysdeps/unix/sysv/linux/ifaddrs.c @@ -244,8 +244,7 @@ void __netlink_close (struct netlink_handle *h) { /* Don't modify errno. */ - INTERNAL_SYSCALL_DECL (err); - (void) INTERNAL_SYSCALL (close, err, 1, h->fd); + INTERNAL_SYSCALL_CALL (close, h->fd); } diff --git a/sysdeps/unix/sysv/linux/internal-signals.h b/sysdeps/unix/sysv/linux/internal-signals.h index bc2f23a..e958522 100644 --- a/sysdeps/unix/sysv/linux/internal-signals.h +++ b/sysdeps/unix/sysv/linux/internal-signals.h @@ -62,8 +62,7 @@ static const sigset_t sigall_set = { static inline void __libc_signal_block_all (sigset_t *set) { - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL_CALL (rt_sigprocmask, err, SIG_BLOCK, &sigall_set, set, + INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_BLOCK, &sigall_set, set, _NSIG / 8); } @@ -73,8 +72,7 @@ __libc_signal_block_app (sigset_t *set) { sigset_t allset = sigall_set; __clear_internal_signals (&allset); - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL_CALL (rt_sigprocmask, err, SIG_BLOCK, &allset, set, + INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_BLOCK, &allset, set, _NSIG / 8); } @@ -82,8 +80,7 @@ __libc_signal_block_app (sigset_t *set) static inline void __libc_signal_restore_set (const sigset_t *set) { - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL_CALL (rt_sigprocmask, err, SIG_SETMASK, set, NULL, + INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_SETMASK, set, NULL, _NSIG / 8); } diff --git a/sysdeps/unix/sysv/linux/libc_fatal.c b/sysdeps/unix/sysv/linux/libc_fatal.c index 5097f41..7e22c0f 100644 --- a/sysdeps/unix/sysv/linux/libc_fatal.c +++ b/sysdeps/unix/sysv/linux/libc_fatal.c @@ -22,12 +22,11 @@ static bool writev_for_fatal (int fd, const struct iovec *iov, size_t niov, size_t total) { - INTERNAL_SYSCALL_DECL (err); ssize_t cnt; do - cnt = INTERNAL_SYSCALL (writev, err, 3, fd, iov, niov); - while (INTERNAL_SYSCALL_ERROR_P (cnt, err) - && INTERNAL_SYSCALL_ERRNO (cnt, err) == EINTR); + cnt = INTERNAL_SYSCALL_CALL (writev, fd, iov, niov); + while (INTERNAL_SYSCALL_ERROR_P (cnt) + && INTERNAL_SYSCALL_ERRNO (cnt) == EINTR); return cnt == total; } #define WRITEV_FOR_FATAL writev_for_fatal diff --git a/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c b/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c index 28b0ee0..1e9c525 100644 --- a/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c +++ b/sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c @@ -25,9 +25,8 @@ if ((unsigned long) (sp) < this_sp) \ { \ stack_t oss; \ - INTERNAL_SYSCALL_DECL (err); \ - int result = INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &oss); \ - if (!INTERNAL_SYSCALL_ERROR_P (result, err) \ + int result = INTERNAL_SYSCALL_CALL (sigaltstack, NULL, &oss); \ + if (!INTERNAL_SYSCALL_ERROR_P (result) \ && ((oss.ss_flags & SS_ONSTACK) == 0 \ || ((unsigned long) oss.ss_sp + oss.ss_size \ - (unsigned long) (sp)) < oss.ss_size)) \ diff --git a/sysdeps/unix/sysv/linux/m68k/brk.c b/sysdeps/unix/sysv/linux/m68k/brk.c index 6ce2f25..ee88acb 100644 --- a/sysdeps/unix/sysv/linux/m68k/brk.c +++ b/sysdeps/unix/sysv/linux/m68k/brk.c @@ -32,8 +32,7 @@ __brk (void *addr) { void *newbrk; - INTERNAL_SYSCALL_DECL (err); - newbrk = (void *) INTERNAL_SYSCALL (brk, err, 1, addr); + newbrk = (void *) INTERNAL_SYSCALL_CALL (brk, addr); __curbrk = newbrk; if (newbrk < addr) diff --git a/sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h b/sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h index 53c30be..ea05b00 100644 --- a/sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h +++ b/sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h @@ -61,6 +61,6 @@ typedef uintmax_t uatomic_max_t; }) # define atomic_full_barrier() \ - (INTERNAL_SYSCALL (atomic_barrier, , 0), (void) 0) + (INTERNAL_SYSCALL_CALL (atomic_barrier), (void) 0) #endif diff --git a/sysdeps/unix/sysv/linux/m68k/getpagesize.c b/sysdeps/unix/sysv/linux/m68k/getpagesize.c index ad65593..b57a03f 100644 --- a/sysdeps/unix/sysv/linux/m68k/getpagesize.c +++ b/sysdeps/unix/sysv/linux/m68k/getpagesize.c @@ -36,10 +36,9 @@ __getpagesize (void) return GLRO(dl_pagesize); #ifdef __NR_getpagesize - INTERNAL_SYSCALL_DECL (err); - result = INTERNAL_SYSCALL (getpagesize, err, 0); + result = INTERNAL_SYSCALL_CALL (getpagesize); /* The only possible error is ENOSYS. */ - if (!INTERNAL_SYSCALL_ERROR_P (result, err)) + if (!INTERNAL_SYSCALL_ERROR_P (result)) return result; #endif diff --git a/sysdeps/unix/sysv/linux/m68k/m68k-helpers.c b/sysdeps/unix/sysv/linux/m68k/m68k-helpers.c index f3bb727..62809e3 100644 --- a/sysdeps/unix/sysv/linux/m68k/m68k-helpers.c +++ b/sysdeps/unix/sysv/linux/m68k/m68k-helpers.c @@ -21,6 +21,5 @@ void * __m68k_read_tp (void) { - INTERNAL_SYSCALL_DECL (err); - return (void*) INTERNAL_SYSCALL_CALL (get_thread_area, err); + return (void*) INTERNAL_SYSCALL_CALL (get_thread_area); } diff --git a/sysdeps/unix/sysv/linux/m68k/sysdep.h b/sysdeps/unix/sysv/linux/m68k/sysdep.h index e3d87be..3e0ab60 100644 --- a/sysdeps/unix/sysv/linux/m68k/sysdep.h +++ b/sysdeps/unix/sysv/linux/m68k/sysdep.h @@ -227,7 +227,7 @@ SYSCALL_ERROR_LABEL: \ normally. It will never touch errno. This returns just what the kernel gave back. */ #undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +#define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ unsigned int _sys_result; \ { \ /* Load argument values in temporary variables @@ -243,8 +243,8 @@ SYSCALL_ERROR_LABEL: \ _sys_result = _d0; \ } \ (int) _sys_result; }) -#define INTERNAL_SYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, ##args) +#define INTERNAL_SYSCALL(name, nr, args...) \ + INTERNAL_SYSCALL_NCS (__NR_##name, nr, ##args) #define LOAD_ARGS_0() #define LOAD_REGS_0 diff --git a/sysdeps/unix/sysv/linux/microblaze/brk.c b/sysdeps/unix/sysv/linux/microblaze/brk.c index 4dd5b76..20c3e62 100644 --- a/sysdeps/unix/sysv/linux/microblaze/brk.c +++ b/sysdeps/unix/sysv/linux/microblaze/brk.c @@ -30,9 +30,7 @@ weak_alias (__curbrk, ___brk_addr) int __brk (void *addr) { - INTERNAL_SYSCALL_DECL (err); - - __curbrk = (void *) INTERNAL_SYSCALL (brk, err, 1, addr); + __curbrk = (void *) INTERNAL_SYSCALL_CALL (brk, addr); if (__curbrk < addr) { __set_errno (ENOMEM); diff --git a/sysdeps/unix/sysv/linux/microblaze/sysdep.h b/sysdeps/unix/sysv/linux/microblaze/sysdep.h index 8f9355f..d500172 100644 --- a/sysdeps/unix/sysv/linux/microblaze/sysdep.h +++ b/sysdeps/unix/sysv/linux/microblaze/sysdep.h @@ -169,11 +169,11 @@ SYSCALL_ERROR_LABEL_DCL: \ normally. It will never touch errno. This returns just what the kernel gave back. */ # undef INTERNAL_SYSCALL -# define INTERNAL_SYSCALL(name, err, nr, args...) \ +# define INTERNAL_SYSCALL(name, nr, args...) \ inline_syscall##nr(SYS_ify(name), args) # undef INTERNAL_SYSCALL_NCS -# define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +# define INTERNAL_SYSCALL_NCS(name, nr, args...) \ inline_syscall##nr(name, args) # define SYSCALL_CLOBBERS_6 "r11", "r4", "memory" diff --git a/sysdeps/unix/sysv/linux/mips/brk.c b/sysdeps/unix/sysv/linux/mips/brk.c index 4ec2a43..0335837 100644 --- a/sysdeps/unix/sysv/linux/mips/brk.c +++ b/sysdeps/unix/sysv/linux/mips/brk.c @@ -30,10 +30,9 @@ weak_alias (__curbrk, ___brk_addr) int __brk (void *addr) { - INTERNAL_SYSCALL_DECL (err); void *newbrk; - newbrk = (void *) INTERNAL_SYSCALL (brk, err, 1, addr); + newbrk = (void *) INTERNAL_SYSCALL_CALL (brk, addr); __curbrk = newbrk; if (newbrk < addr) diff --git a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h index 7c04819..c5bcd90 100644 --- a/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h +++ b/sysdeps/unix/sysv/linux/mips/mips32/sysdep.h @@ -95,10 +95,10 @@ union __mips_syscall_return # include -# define INTERNAL_SYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL_NCS (SYS_ify (name), err, nr, args) +# define INTERNAL_SYSCALL(name, nr, args...) \ + INTERNAL_SYSCALL_NCS (SYS_ify (name), nr, args) -# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ +# define INTERNAL_SYSCALL_NCS(number, nr, args...) \ ({ \ union __mips_syscall_return _sc_ret; \ _sc_ret.val = __mips16_syscall##nr (args, number); \ @@ -111,12 +111,12 @@ union __mips_syscall_return number, err, args) #else /* !__mips16 */ -# define INTERNAL_SYSCALL(name, err, nr, args...) \ +# define INTERNAL_SYSCALL(name, nr, args...) \ internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t", \ "IK" (SYS_ify (name)), \ SYS_ify (name), err, args) -# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ +# define INTERNAL_SYSCALL_NCS(number, nr, args...) \ internal_syscall##nr (MOVE32 "\t%0, %2\n\t", \ "r" (__s0), \ number, err, args) diff --git a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c index 6d36ada..cd495a3 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c +++ b/sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c @@ -40,15 +40,14 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag) } int result; - INTERNAL_SYSCALL_DECL (err); struct kernel_stat kst; - result = INTERNAL_SYSCALL (newfstatat, err, 4, fd, file, &kst, flag); - if (!__builtin_expect (INTERNAL_SYSCALL_ERROR_P (result, err), 1)) + result = INTERNAL_SYSCALL_CALL (newfstatat, fd, file, &kst, flag); + if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result))) return __xstat64_conv (vers, &kst, st); else { - __set_errno (INTERNAL_SYSCALL_ERRNO (result, err)); + __set_errno (INTERNAL_SYSCALL_ERRNO (result)); return -1; } } diff --git a/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h b/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h index 112d940..1882fe4 100644 --- a/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h +++ b/sysdeps/unix/sysv/linux/mips/mips64/sysdep.h @@ -79,18 +79,18 @@ typedef long int __syscall_arg_t; #endif #undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) \ +#define INTERNAL_SYSCALL(name, nr, args...) \ internal_syscall##nr ("li\t%0, %2\t\t\t# " #name "\n\t", \ "IK" (SYS_ify (name)), \ - 0, err, args) + 0, args) #undef INTERNAL_SYSCALL_NCS -#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ +#define INTERNAL_SYSCALL_NCS(number, nr, args...) \ internal_syscall##nr (MOVE32 "\t%0, %2\n\t", \ "r" (__s0), \ - number, err, args) + number, args) -#define internal_syscall0(v0_init, input, number, err, dummy...) \ +#define internal_syscall0(v0_init, input, number, dummy...) \ ({ \ long int _sys_result; \ \ @@ -112,7 +112,7 @@ typedef long int __syscall_arg_t; _sys_result; \ }) -#define internal_syscall1(v0_init, input, number, err, arg1) \ +#define internal_syscall1(v0_init, input, number, arg1) \ ({ \ long int _sys_result; \ \ @@ -136,7 +136,7 @@ typedef long int __syscall_arg_t; _sys_result; \ }) -#define internal_syscall2(v0_init, input, number, err, arg1, arg2) \ +#define internal_syscall2(v0_init, input, number, arg1, arg2) \ ({ \ long int _sys_result; \ \ @@ -162,8 +162,7 @@ typedef long int __syscall_arg_t; _sys_result; \ }) -#define internal_syscall3(v0_init, input, number, err, \ - arg1, arg2, arg3) \ +#define internal_syscall3(v0_init, input, number, arg1, arg2, arg3) \ ({ \ long int _sys_result; \ \ @@ -191,8 +190,8 @@ typedef long int __syscall_arg_t; _sys_result; \ }) -#define internal_syscall4(v0_init, input, number, err, \ - arg1, arg2, arg3, arg4) \ +#define internal_syscall4(v0_init, input, number, arg1, arg2, arg3, \ + arg4) \ ({ \ long int _sys_result; \ \ @@ -221,8 +220,8 @@ typedef long int __syscall_arg_t; _sys_result; \ }) -#define internal_syscall5(v0_init, input, number, err, \ - arg1, arg2, arg3, arg4, arg5) \ +#define internal_syscall5(v0_init, input, number, arg1, arg2, arg3, \ + arg4, arg5) \ ({ \ long int _sys_result; \ \ @@ -253,8 +252,8 @@ typedef long int __syscall_arg_t; _sys_result; \ }) -#define internal_syscall6(v0_init, input, number, err, \ - arg1, arg2, arg3, arg4, arg5, arg6) \ +#define internal_syscall6(v0_init, input, number, arg1, arg2, arg3, \ + arg4, arg5, arg6) \ ({ \ long int _sys_result; \ \ diff --git a/sysdeps/unix/sysv/linux/mq_unlink.c b/sysdeps/unix/sysv/linux/mq_unlink.c index a0c3348..4ea882d 100644 --- a/sysdeps/unix/sysv/linux/mq_unlink.c +++ b/sysdeps/unix/sysv/linux/mq_unlink.c @@ -28,14 +28,13 @@ mq_unlink (const char *name) if (name[0] != '/') return INLINE_SYSCALL_ERROR_RETURN_VALUE (EINVAL); - INTERNAL_SYSCALL_DECL (err); - int ret = INTERNAL_SYSCALL (mq_unlink, err, 1, name + 1); + int ret = INTERNAL_SYSCALL_CALL (mq_unlink, name + 1); /* While unlink can return either EPERM or EACCES, mq_unlink should return just EACCES. */ - if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (ret, err))) + if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (ret))) { - ret = INTERNAL_SYSCALL_ERRNO (ret, err); + ret = INTERNAL_SYSCALL_ERRNO (ret); if (ret == EPERM) ret = EACCES; return INLINE_SYSCALL_ERROR_RETURN_VALUE (ret); diff --git a/sysdeps/unix/sysv/linux/nios2/sysdep.h b/sysdeps/unix/sysv/linux/nios2/sysdep.h index 45ef817..dbd23b8 100644 --- a/sysdeps/unix/sysv/linux/nios2/sysdep.h +++ b/sysdeps/unix/sysv/linux/nios2/sysdep.h @@ -145,7 +145,7 @@ # undef HAVE_INTERNAL_SEND_SYMBOL #undef INTERNAL_SYSCALL_RAW -#define INTERNAL_SYSCALL_RAW(name, err, nr, args...) \ +#define INTERNAL_SYSCALL_RAW(name, nr, args...) \ ({ unsigned int _sys_result; \ { \ /* Load argument values in temporary variables @@ -164,12 +164,12 @@ (int) _sys_result; }) #undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL_RAW(SYS_ify(name), err, nr, args) +#define INTERNAL_SYSCALL(name, nr, args...) \ + INTERNAL_SYSCALL_RAW(SYS_ify(name), nr, args) #undef INTERNAL_SYSCALL_NCS -#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ - INTERNAL_SYSCALL_RAW(number, err, nr, args) +#define INTERNAL_SYSCALL_NCS(number, nr, args...) \ + INTERNAL_SYSCALL_RAW(number, nr, args) #define LOAD_ARGS_0() #define LOAD_REGS_0 diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h index df6023a..bf09a3d 100644 --- a/sysdeps/unix/sysv/linux/not-cancel.h +++ b/sysdeps/unix/sysv/linux/not-cancel.h @@ -65,8 +65,7 @@ __close_nocancel_nostatus (int fd) static inline void __writev_nocancel_nostatus (int fd, const struct iovec *iov, int iovcnt) { - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL_CALL (writev, err, fd, iov, iovcnt); + INTERNAL_SYSCALL_CALL (writev, fd, iov, iovcnt); } /* Uncancelable fcntl. */ diff --git a/sysdeps/unix/sysv/linux/not-errno.h b/sysdeps/unix/sysv/linux/not-errno.h index cdc9d9b..394dabe 100644 --- a/sysdeps/unix/sysv/linux/not-errno.h +++ b/sysdeps/unix/sysv/linux/not-errno.h @@ -26,14 +26,13 @@ static inline int __access_noerrno (const char *pathname, int mode) { int res; - INTERNAL_SYSCALL_DECL (err); #ifdef __NR_access - res = INTERNAL_SYSCALL_CALL (access, err, pathname, mode); + res = INTERNAL_SYSCALL_CALL (access, pathname, mode); #else - res = INTERNAL_SYSCALL_CALL (faccessat, err, AT_FDCWD, pathname, mode); + res = INTERNAL_SYSCALL_CALL (faccessat, AT_FDCWD, pathname, mode); #endif - if (INTERNAL_SYSCALL_ERROR_P (res, err)) - return INTERNAL_SYSCALL_ERRNO (res, err); + if (INTERNAL_SYSCALL_ERROR_P (res)) + return INTERNAL_SYSCALL_ERRNO (res); return 0; } @@ -41,9 +40,8 @@ static inline int __kill_noerrno (pid_t pid, int sig) { int res; - INTERNAL_SYSCALL_DECL (err); - res = INTERNAL_SYSCALL_CALL (kill, err, pid, sig); - if (INTERNAL_SYSCALL_ERROR_P (res, err)) - return INTERNAL_SYSCALL_ERRNO (res, err); + res = INTERNAL_SYSCALL_CALL (kill, pid, sig); + if (INTERNAL_SYSCALL_ERROR_P (res)) + return INTERNAL_SYSCALL_ERRNO (res); return 0; } diff --git a/sysdeps/unix/sysv/linux/nscd_setup_thread.c b/sysdeps/unix/sysv/linux/nscd_setup_thread.c index 6e14918..fe77704 100644 --- a/sysdeps/unix/sysv/linux/nscd_setup_thread.c +++ b/sysdeps/unix/sysv/linux/nscd_setup_thread.c @@ -35,10 +35,9 @@ setup_thread (struct database_dyn *db) /* Do not try this at home, kids. We play with the SETTID address even thought the process is multi-threaded. This can only work since none of the threads ever terminates. */ - INTERNAL_SYSCALL_DECL (err); - int r = INTERNAL_SYSCALL (set_tid_address, err, 1, - &db->head->nscd_certainly_running); - if (!INTERNAL_SYSCALL_ERROR_P (r, err)) + int r = INTERNAL_SYSCALL_CALL (set_tid_address, + &db->head->nscd_certainly_running); + if (!INTERNAL_SYSCALL_ERROR_P (r)) /* We know the kernel can reset this field when nscd terminates. So, set the field to a nonzero value which indicates that nscd is certainly running and clients can skip the test. */ diff --git a/sysdeps/unix/sysv/linux/personality.c b/sysdeps/unix/sysv/linux/personality.c index 970bd7b..e45fffa 100644 --- a/sysdeps/unix/sysv/linux/personality.c +++ b/sysdeps/unix/sysv/linux/personality.c @@ -35,15 +35,14 @@ __personality (unsigned long persona) persona = (unsigned int) persona; #endif - INTERNAL_SYSCALL_DECL (err); - long ret = INTERNAL_SYSCALL (personality, err, 1, persona); + long int ret = INTERNAL_SYSCALL_CALL (personality, persona); /* Starting with kernel commit v2.6.29-6609-g11d06b2, the personality syscall never fails. However, 32-bit kernels might flag valid values as errors, so we need to reverse the error setting. We can't use the raw result as some arches split the return/error values. */ - if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (ret, err))) - ret = -INTERNAL_SYSCALL_ERRNO (ret, err); + if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (ret))) + ret = -INTERNAL_SYSCALL_ERRNO (ret); return ret; } weak_alias (__personality, personality) diff --git a/sysdeps/unix/sysv/linux/posix_fadvise.c b/sysdeps/unix/sysv/linux/posix_fadvise.c index 63965dd..bada96b 100644 --- a/sysdeps/unix/sysv/linux/posix_fadvise.c +++ b/sysdeps/unix/sysv/linux/posix_fadvise.c @@ -41,14 +41,13 @@ int posix_fadvise (int fd, off_t offset, off_t len, int advise) { - INTERNAL_SYSCALL_DECL (err); # if defined (__NR_fadvise64) && !defined (__ASSUME_FADVISE64_AS_64_64) - int ret = INTERNAL_SYSCALL_CALL (fadvise64, err, fd, + int ret = INTERNAL_SYSCALL_CALL (fadvise64, fd, __ALIGNMENT_ARG SYSCALL_LL (offset), len, advise); # else # ifdef __ASSUME_FADVISE64_64_6ARG - int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, err, fd, advise, + int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, fd, advise, SYSCALL_LL (offset), SYSCALL_LL (len)); # else @@ -56,13 +55,13 @@ posix_fadvise (int fd, off_t offset, off_t len, int advise) # define __NR_fadvise64_64 __NR_fadvise64 # endif - int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, err, fd, + int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, fd, __ALIGNMENT_ARG SYSCALL_LL (offset), SYSCALL_LL (len), advise); # endif # endif - if (INTERNAL_SYSCALL_ERROR_P (ret, err)) - return INTERNAL_SYSCALL_ERRNO (ret, err); + if (INTERNAL_SYSCALL_ERROR_P (ret)) + return INTERNAL_SYSCALL_ERRNO (ret); return 0; } #endif /* __OFF_T_MATCHES_OFF64_T */ diff --git a/sysdeps/unix/sysv/linux/posix_fadvise64.c b/sysdeps/unix/sysv/linux/posix_fadvise64.c index c0fa6e3..9787ab4 100644 --- a/sysdeps/unix/sysv/linux/posix_fadvise64.c +++ b/sysdeps/unix/sysv/linux/posix_fadvise64.c @@ -40,18 +40,17 @@ libc_hidden_proto (__posix_fadvise64_l64) int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) { - INTERNAL_SYSCALL_DECL (err); #ifdef __ASSUME_FADVISE64_64_6ARG - int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, err, fd, advise, + int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, fd, advise, SYSCALL_LL64 (offset), SYSCALL_LL64 (len)); #else - int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, err, fd, + int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, fd, __ALIGNMENT_ARG SYSCALL_LL64 (offset), SYSCALL_LL64 (len), advise); #endif - if (!INTERNAL_SYSCALL_ERROR_P (ret, err)) + if (!INTERNAL_SYSCALL_ERROR_P (ret)) return 0; - return INTERNAL_SYSCALL_ERRNO (ret, err); + return INTERNAL_SYSCALL_ERRNO (ret); } /* The type of the len argument was changed from size_t to off_t in diff --git a/sysdeps/unix/sysv/linux/posix_fallocate.c b/sysdeps/unix/sysv/linux/posix_fallocate.c index 7af973b..7238b00 100644 --- a/sysdeps/unix/sysv/linux/posix_fallocate.c +++ b/sysdeps/unix/sysv/linux/posix_fallocate.c @@ -26,12 +26,11 @@ int posix_fallocate (int fd, __off_t offset, __off_t len) { - INTERNAL_SYSCALL_DECL (err); - int res = INTERNAL_SYSCALL_CALL (fallocate, err, fd, 0, + int res = INTERNAL_SYSCALL_CALL (fallocate, fd, 0, SYSCALL_LL (offset), SYSCALL_LL (len)); - if (! INTERNAL_SYSCALL_ERROR_P (res, err)) + if (! INTERNAL_SYSCALL_ERROR_P (res)) return 0; - if (INTERNAL_SYSCALL_ERRNO (res, err) != EOPNOTSUPP) - return INTERNAL_SYSCALL_ERRNO (res, err); + if (INTERNAL_SYSCALL_ERRNO (res) != EOPNOTSUPP) + return INTERNAL_SYSCALL_ERRNO (res); return internal_fallocate (fd, offset, len); } diff --git a/sysdeps/unix/sysv/linux/posix_fallocate64.c b/sysdeps/unix/sysv/linux/posix_fallocate64.c index ce8de71..2de63ac 100644 --- a/sysdeps/unix/sysv/linux/posix_fallocate64.c +++ b/sysdeps/unix/sysv/linux/posix_fallocate64.c @@ -28,19 +28,12 @@ libc_hidden_proto (__posix_fallocate64_l64) int __posix_fallocate64_l64 (int fd, __off64_t offset, __off64_t len) { - INTERNAL_SYSCALL_DECL (err); -#ifdef INTERNAL_SYSCALL_TYPES - int res = INTERNAL_SYSCALL_TYPES (fallocate, err, 4, int, fd, - int, 0, off_t, offset, - off_t, len); -#else - int res = INTERNAL_SYSCALL_CALL (fallocate, err, fd, 0, + int res = INTERNAL_SYSCALL_CALL (fallocate, fd, 0, SYSCALL_LL64 (offset), SYSCALL_LL64 (len)); -#endif - if (! INTERNAL_SYSCALL_ERROR_P (res, err)) + if (! INTERNAL_SYSCALL_ERROR_P (res)) return 0; - if (INTERNAL_SYSCALL_ERRNO (res, err) != EOPNOTSUPP) - return INTERNAL_SYSCALL_ERRNO (res, err); + if (INTERNAL_SYSCALL_ERRNO (res) != EOPNOTSUPP) + return INTERNAL_SYSCALL_ERRNO (res); return internal_fallocate64 (fd, offset, len); } libc_hidden_def (__posix_fallocate64_l64) diff --git a/sysdeps/unix/sysv/linux/posix_madvise.c b/sysdeps/unix/sysv/linux/posix_madvise.c index daff027..0e49f3b 100644 --- a/sysdeps/unix/sysv/linux/posix_madvise.c +++ b/sysdeps/unix/sysv/linux/posix_madvise.c @@ -31,7 +31,6 @@ posix_madvise (void *addr, size_t len, int advice) if (advice == POSIX_MADV_DONTNEED) return 0; - INTERNAL_SYSCALL_DECL (err); - int result = INTERNAL_SYSCALL (madvise, err, 3, addr, len, advice); - return INTERNAL_SYSCALL_ERRNO (result, err); + int result = INTERNAL_SYSCALL_CALL (madvise, addr, len, advice); + return INTERNAL_SYSCALL_ERRNO (result); } diff --git a/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c b/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c index 81f7c73..279b86e 100644 --- a/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c +++ b/sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c @@ -105,7 +105,6 @@ __get_timebase_freq (void) if (vdsop == NULL) return get_timebase_freq_fallback (); - INTERNAL_SYSCALL_DECL (err); - return INTERNAL_VSYSCALL_CALL_TYPE (vdsop, err, uint64_t, 0); + return INTERNAL_VSYSCALL_CALL_TYPE (vdsop, uint64_t, 0); } weak_alias (__get_timebase_freq, __ppc_get_timebase_freq) diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c index 61164f2..1a047fb 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c @@ -26,8 +26,7 @@ const fenv_t * __fe_mask_env (void) { - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_DISABLED); + INTERNAL_SYSCALL_CALL (prctl, PR_SET_FPEXC, PR_FP_EXC_DISABLED); return FE_DFL_ENV; } diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c index 6ee75f6..1c40cd3 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c @@ -27,8 +27,7 @@ const fenv_t * __fe_nomask_env_priv (void) { - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE); + INTERNAL_SYSCALL_CALL (prctl, PR_SET_FPEXC, PR_FP_EXC_PRECISE); return FE_ENABLED_ENV; } diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c index 61fd3b0..02ed0a6 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c @@ -26,8 +26,7 @@ const fenv_t * __fe_mask_env (void) { #if defined PR_SET_FPEXC && defined PR_FP_EXC_DISABLED - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_DISABLED); + INTERNAL_SYSCALL_CALL (prctl, PR_SET_FPEXC, PR_FP_EXC_DISABLED); #else __set_errno (ENOSYS); #endif diff --git a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c index f4febe7..33a36e2 100644 --- a/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c +++ b/sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c @@ -27,8 +27,7 @@ const fenv_t * __fe_nomask_env_priv (void) { #if defined PR_SET_FPEXC && defined PR_FP_EXC_PRECISE - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL (prctl, err, 2, PR_SET_FPEXC, PR_FP_EXC_PRECISE); + INTERNAL_SYSCALL_CALL (prctl, PR_SET_FPEXC, PR_FP_EXC_PRECISE); #else __set_errno (ENOSYS); #endif diff --git a/sysdeps/unix/sysv/linux/powerpc/sysdep.h b/sysdeps/unix/sysv/linux/powerpc/sysdep.h index 9442839..fd79bbc 100644 --- a/sysdeps/unix/sysv/linux/powerpc/sysdep.h +++ b/sysdeps/unix/sysv/linux/powerpc/sysdep.h @@ -38,7 +38,7 @@ gave back in the non-error (CR0.SO cleared) case, otherwise (CR0.SO set) the negation of the return value in the kernel gets reverted. */ -#define INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, type, nr, args...) \ +#define INTERNAL_VSYSCALL_CALL_TYPE(funcptr, type, nr, args...) \ ({ \ register void *r0 __asm__ ("r0"); \ register long int r3 __asm__ ("r3"); \ @@ -61,12 +61,12 @@ (long int) r0 & (1 << 28) ? -rval : rval; \ }) -#define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ - INTERNAL_VSYSCALL_CALL_TYPE(funcptr, err, long int, nr, args) +#define INTERNAL_VSYSCALL_CALL(funcptr, nr, args...) \ + INTERNAL_VSYSCALL_CALL_TYPE(funcptr, long int, nr, args) #undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +#define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ \ register long int r0 __asm__ ("r0"); \ register long int r3 __asm__ ("r3"); \ @@ -88,8 +88,8 @@ "cr0", "ctr", "memory"); \ r0 & (1 << 28) ? -r3 : r3; \ }) -#define INTERNAL_SYSCALL(name, err, nr, args...) \ - INTERNAL_SYSCALL_NCS (__NR_##name, err, nr, args) +#define INTERNAL_SYSCALL(name, nr, args...) \ + INTERNAL_SYSCALL_NCS (__NR_##name, nr, args) #if defined(__PPC64__) || defined(__powerpc64__) # define SYSCALL_ARG_SIZE 8 diff --git a/sysdeps/unix/sysv/linux/pthread-pids.h b/sysdeps/unix/sysv/linux/pthread-pids.h index 50c022e..0b8ca4e 100644 --- a/sysdeps/unix/sysv/linux/pthread-pids.h +++ b/sysdeps/unix/sysv/linux/pthread-pids.h @@ -25,6 +25,5 @@ static inline void __pthread_initialize_pids (struct pthread *pd) { - INTERNAL_SYSCALL_DECL (err); - pd->tid = INTERNAL_SYSCALL_CALL (set_tid_address, err, &pd->tid); + pd->tid = INTERNAL_SYSCALL_CALL (set_tid_address, &pd->tid); } diff --git a/sysdeps/unix/sysv/linux/pthread_getaffinity.c b/sysdeps/unix/sysv/linux/pthread_getaffinity.c index a3d5856..cf6ecfe 100644 --- a/sysdeps/unix/sysv/linux/pthread_getaffinity.c +++ b/sysdeps/unix/sysv/linux/pthread_getaffinity.c @@ -31,11 +31,10 @@ __pthread_getaffinity_new (pthread_t th, size_t cpusetsize, cpu_set_t *cpuset) { const struct pthread *pd = (const struct pthread *) th; - INTERNAL_SYSCALL_DECL (err); - int res = INTERNAL_SYSCALL (sched_getaffinity, err, 3, pd->tid, - MIN (INT_MAX, cpusetsize), cpuset); - if (INTERNAL_SYSCALL_ERROR_P (res, err)) - return INTERNAL_SYSCALL_ERRNO (res, err); + int res = INTERNAL_SYSCALL_CALL (sched_getaffinity, pd->tid, + MIN (INT_MAX, cpusetsize), cpuset); + if (INTERNAL_SYSCALL_ERROR_P (res)) + return INTERNAL_SYSCALL_ERRNO (res); /* Clean the rest of the memory the kernel didn't do. */ memset ((char *) cpuset + res, '\0', cpusetsize - res); diff --git a/sysdeps/unix/sysv/linux/pthread_kill.c b/sysdeps/unix/sysv/linux/pthread_kill.c index 1d63100..4dfe08f 100644 --- a/sysdeps/unix/sysv/linux/pthread_kill.c +++ b/sysdeps/unix/sysv/linux/pthread_kill.c @@ -48,12 +48,10 @@ __pthread_kill (pthread_t threadid, int signo) return EINVAL; /* We have a special syscall to do the work. */ - INTERNAL_SYSCALL_DECL (err); - pid_t pid = __getpid (); - int val = INTERNAL_SYSCALL_CALL (tgkill, err, pid, tid, signo); - return (INTERNAL_SYSCALL_ERROR_P (val, err) - ? INTERNAL_SYSCALL_ERRNO (val, err) : 0); + int val = INTERNAL_SYSCALL_CALL (tgkill, pid, tid, signo); + return (INTERNAL_SYSCALL_ERROR_P (val) + ? INTERNAL_SYSCALL_ERRNO (val) : 0); } strong_alias (__pthread_kill, pthread_kill) diff --git a/sysdeps/unix/sysv/linux/pthread_setaffinity.c b/sysdeps/unix/sysv/linux/pthread_setaffinity.c index 746824c..264d677 100644 --- a/sysdeps/unix/sysv/linux/pthread_setaffinity.c +++ b/sysdeps/unix/sysv/linux/pthread_setaffinity.c @@ -28,19 +28,18 @@ __pthread_setaffinity_new (pthread_t th, size_t cpusetsize, const cpu_set_t *cpuset) { const struct pthread *pd = (const struct pthread *) th; - INTERNAL_SYSCALL_DECL (err); int res; - res = INTERNAL_SYSCALL (sched_setaffinity, err, 3, pd->tid, cpusetsize, - cpuset); + res = INTERNAL_SYSCALL_CALL (sched_setaffinity, pd->tid, cpusetsize, + cpuset); #ifdef RESET_VGETCPU_CACHE - if (!INTERNAL_SYSCALL_ERROR_P (res, err)) + if (!INTERNAL_SYSCALL_ERROR_P (res)) RESET_VGETCPU_CACHE (); #endif - return (INTERNAL_SYSCALL_ERROR_P (res, err) - ? INTERNAL_SYSCALL_ERRNO (res, err) + return (INTERNAL_SYSCALL_ERROR_P (res) + ? INTERNAL_SYSCALL_ERRNO (res) : 0); } versioned_symbol (libpthread, __pthread_setaffinity_new, diff --git a/sysdeps/unix/sysv/linux/pthread_sigqueue.c b/sysdeps/unix/sysv/linux/pthread_sigqueue.c index 52d815a..4b32be2 100644 --- a/sysdeps/unix/sysv/linux/pthread_sigqueue.c +++ b/sysdeps/unix/sysv/linux/pthread_sigqueue.c @@ -61,12 +61,10 @@ pthread_sigqueue (pthread_t threadid, int signo, const union sigval value) info.si_value = value; /* We have a special syscall to do the work. */ - INTERNAL_SYSCALL_DECL (err); - - int val = INTERNAL_SYSCALL_CALL (rt_tgsigqueueinfo, err, pid, tid, signo, + int val = INTERNAL_SYSCALL_CALL (rt_tgsigqueueinfo, pid, tid, signo, &info); - return (INTERNAL_SYSCALL_ERROR_P (val, err) - ? INTERNAL_SYSCALL_ERRNO (val, err) : 0); + return (INTERNAL_SYSCALL_ERROR_P (val) + ? INTERNAL_SYSCALL_ERRNO (val) : 0); #else return ENOSYS; #endif diff --git a/sysdeps/unix/sysv/linux/raise.c b/sysdeps/unix/sysv/linux/raise.c index 4c9f3fa..3b90ae1 100644 --- a/sysdeps/unix/sysv/linux/raise.c +++ b/sysdeps/unix/sysv/linux/raise.c @@ -39,11 +39,10 @@ raise (int sig) sigset_t set; __libc_signal_block_app (&set); - INTERNAL_SYSCALL_DECL (err); - pid_t pid = INTERNAL_SYSCALL (getpid, err, 0); - pid_t tid = INTERNAL_SYSCALL (gettid, err, 0); + pid_t pid = INTERNAL_SYSCALL_CALL (getpid); + pid_t tid = INTERNAL_SYSCALL_CALL (gettid); - int ret = INLINE_SYSCALL (tgkill, 3, pid, tid, sig); + int ret = INLINE_SYSCALL_CALL (tgkill, pid, tid, sig); __libc_signal_restore_set (&set); diff --git a/sysdeps/unix/sysv/linux/riscv/syscall.c b/sysdeps/unix/sysv/linux/riscv/syscall.c index 9d0e417..a99375c 100644 --- a/sysdeps/unix/sysv/linux/riscv/syscall.c +++ b/sysdeps/unix/sysv/linux/riscv/syscall.c @@ -23,12 +23,11 @@ syscall (long int syscall_number, long int arg1, long int arg2, long int arg3, long int arg4, long int arg5, long int arg6, long int arg7) { long int ret; - INTERNAL_SYSCALL_DECL (err); - ret = INTERNAL_SYSCALL_NCS (syscall_number, err, 7, arg1, arg2, arg3, arg4, + ret = INTERNAL_SYSCALL_NCS (syscall_number, 7, arg1, arg2, arg3, arg4, arg5, arg6, arg7); - if (INTERNAL_SYSCALL_ERROR_P (ret, err)) + if (INTERNAL_SYSCALL_ERROR_P (ret)) return __syscall_error (ret); return ret; diff --git a/sysdeps/unix/sysv/linux/riscv/sysdep.h b/sysdeps/unix/sysv/linux/riscv/sysdep.h index e46160f..83e4adf 100644 --- a/sysdeps/unix/sysv/linux/riscv/sysdep.h +++ b/sysdeps/unix/sysv/linux/riscv/sysdep.h @@ -130,13 +130,13 @@ # define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday" # define HAVE_GETCPU_VSYSCALL "__vdso_getcpu" -# define INTERNAL_SYSCALL(name, err, nr, args...) \ - internal_syscall##nr (SYS_ify (name), err, args) +# define INTERNAL_SYSCALL(name, nr, args...) \ + internal_syscall##nr (SYS_ify (name), args) -# define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ - internal_syscall##nr (number, err, args) +# define INTERNAL_SYSCALL_NCS(number, nr, args...) \ + internal_syscall##nr (number, args) -# define internal_syscall0(number, err, dummy...) \ +# define internal_syscall0(number, dummy...) \ ({ \ long int _sys_result; \ \ @@ -153,7 +153,7 @@ _sys_result; \ }) -# define internal_syscall1(number, err, arg0) \ +# define internal_syscall1(number, arg0) \ ({ \ long int _sys_result; \ long int _arg0 = (long int) (arg0); \ @@ -171,7 +171,7 @@ _sys_result; \ }) -# define internal_syscall2(number, err, arg0, arg1) \ +# define internal_syscall2(number, arg0, arg1) \ ({ \ long int _sys_result; \ long int _arg0 = (long int) (arg0); \ @@ -191,7 +191,7 @@ _sys_result; \ }) -# define internal_syscall3(number, err, arg0, arg1, arg2) \ +# define internal_syscall3(number, arg0, arg1, arg2) \ ({ \ long int _sys_result; \ long int _arg0 = (long int) (arg0); \ @@ -213,7 +213,7 @@ _sys_result; \ }) -# define internal_syscall4(number, err, arg0, arg1, arg2, arg3) \ +# define internal_syscall4(number, arg0, arg1, arg2, arg3) \ ({ \ long int _sys_result; \ long int _arg0 = (long int) (arg0); \ @@ -237,7 +237,7 @@ _sys_result; \ }) -# define internal_syscall5(number, err, arg0, arg1, arg2, arg3, arg4) \ +# define internal_syscall5(number, arg0, arg1, arg2, arg3, arg4) \ ({ \ long int _sys_result; \ long int _arg0 = (long int) (arg0); \ @@ -263,7 +263,7 @@ _sys_result; \ }) -# define internal_syscall6(number, err, arg0, arg1, arg2, arg3, arg4, arg5) \ +# define internal_syscall6(number, arg0, arg1, arg2, arg3, arg4, arg5) \ ({ \ long int _sys_result; \ long int _arg0 = (long int) (arg0); \ @@ -292,7 +292,7 @@ _sys_result; \ }) -# define internal_syscall7(number, err, arg0, arg1, arg2, arg3, arg4, arg5, arg6) \ +# define internal_syscall7(number, arg0, arg1, arg2, arg3, arg4, arg5, arg6) \ ({ \ long int _sys_result; \ long int _arg0 = (long int) (arg0); \ diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c index 28fa16f..1f21417 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c +++ b/sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c @@ -39,9 +39,8 @@ if (new_sp < cur_sp) \ { \ stack_t oss; \ - INTERNAL_SYSCALL_DECL (err); \ - int res = INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &oss); \ - if (!INTERNAL_SYSCALL_ERROR_P (res, err)) \ + int res = INTERNAL_SYSCALL_CALL (sigaltstack, NULL, &oss); \ + if (!INTERNAL_SYSCALL_ERROR_P (res)) \ { \ if ((oss.ss_flags & SS_ONSTACK) == 0 \ || ((uintptr_t) (oss.ss_sp + oss.ss_size) - new_sp \ diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c b/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c index c984779..b556a6c 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c +++ b/sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c @@ -37,16 +37,15 @@ int __posix_fadvise64_l64 (int fd, off64_t offset, off64_t len, int advise) { struct fadvise64_64_layout parameters; - INTERNAL_SYSCALL_DECL (err); parameters.fd = fd; parameters.offset = offset; parameters.len = len; parameters.advise = advise; - int ret = INTERNAL_SYSCALL (fadvise64_64, err, 1, ¶meters); - if (!INTERNAL_SYSCALL_ERROR_P (ret, err)) + int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, ¶meters); + if (!INTERNAL_SYSCALL_ERROR_P (ret)) return 0; - return INTERNAL_SYSCALL_ERRNO (ret, err); + return INTERNAL_SYSCALL_ERRNO (ret); } #include diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h index 98e5ba0..26b0410 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h @@ -82,6 +82,7 @@ #undef SYSCALL_ERROR_LABEL #ifndef PIC +# undef SYSCALL_ERROR_LABEL # define SYSCALL_ERROR_LABEL 0f # define SYSCALL_ERROR_HANDLER \ 0: basr %r1,0; \ @@ -90,6 +91,7 @@ 2: .long syscall_error #else # if RTLD_PRIVATE_ERRNO +# undef SYSCALL_ERROR_LABEL # define SYSCALL_ERROR_LABEL 0f # define SYSCALL_ERROR_HANDLER \ 0: basr %r1,0; \ @@ -105,6 +107,7 @@ # else # define SYSCALL_ERROR_ERRNO errno # endif +# undef SYSCALL_ERROR_LABEL # define SYSCALL_ERROR_LABEL 0f # define SYSCALL_ERROR_HANDLER \ 0: lcr %r0,%r2; \ @@ -117,6 +120,7 @@ br %r14; \ 2: .long _GLOBAL_OFFSET_TABLE_-1b # else +# undef SYSCALL_ERROR_LABEL # define SYSCALL_ERROR_LABEL 0f # define SYSCALL_ERROR_HANDLER \ 0: basr %r1,0; \ diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c index 1305c81..bc74408 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c +++ b/sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c @@ -39,9 +39,8 @@ if (new_sp < cur_sp) \ { \ stack_t oss; \ - INTERNAL_SYSCALL_DECL (err); \ - int res = INTERNAL_SYSCALL (sigaltstack, err, 2, NULL, &oss); \ - if (!INTERNAL_SYSCALL_ERROR_P (res, err)) \ + int res = INTERNAL_SYSCALL_CALL (sigaltstack, NULL, &oss); \ + if (!INTERNAL_SYSCALL_ERROR_P (res)) \ { \ if ((oss.ss_flags & SS_ONSTACK) == 0 \ || ((uintptr_t) (oss.ss_sp + oss.ss_size) - new_sp \ diff --git a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h index 2a4874c..c761a63 100644 --- a/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h @@ -96,10 +96,12 @@ #undef SYSCALL_ERROR_LABEL #ifndef PIC +# undef SYSCALL_ERROR_LABEL # define SYSCALL_ERROR_LABEL syscall_error # define SYSCALL_ERROR_HANDLER #else # if RTLD_PRIVATE_ERRNO +# undef SYSCALL_ERROR_LABEL # define SYSCALL_ERROR_LABEL 0f # define SYSCALL_ERROR_HANDLER \ 0: larl %r1,rtld_errno; \ @@ -113,6 +115,7 @@ # else # define SYSCALL_ERROR_ERRNO errno # endif +# undef SYSCALL_ERROR_LABEL # define SYSCALL_ERROR_LABEL 0f # define SYSCALL_ERROR_HANDLER \ 0: lcr %r0,%r2; \ @@ -125,6 +128,7 @@ lghi %r2,-1; \ br %r14 # else +# undef SYSCALL_ERROR_LABEL # define SYSCALL_ERROR_LABEL 0f # define SYSCALL_ERROR_HANDLER \ 0: larl %r1,_GLOBAL_OFFSET_TABLE_; \ diff --git a/sysdeps/unix/sysv/linux/s390/sysdep.h b/sysdeps/unix/sysv/linux/s390/sysdep.h index e0e25c9..e392960 100644 --- a/sysdeps/unix/sysv/linux/s390/sysdep.h +++ b/sysdeps/unix/sysv/linux/s390/sysdep.h @@ -22,7 +22,7 @@ #define SYS_ify(syscall_name) __NR_##syscall_name #undef INTERNAL_SYSCALL_DIRECT -#define INTERNAL_SYSCALL_DIRECT(name, err, nr, args...) \ +#define INTERNAL_SYSCALL_DIRECT(name, nr, args...) \ ({ \ DECLARGS_##nr(args) \ register long int _ret __asm__("2"); \ @@ -34,7 +34,7 @@ _ret; }) #undef INTERNAL_SYSCALL_SVC0 -#define INTERNAL_SYSCALL_SVC0(name, err, nr, args...) \ +#define INTERNAL_SYSCALL_SVC0(name, nr, args...) \ ({ \ DECLARGS_##nr(args) \ register unsigned long int _nr __asm__("1") = \ @@ -48,7 +48,7 @@ _ret; }) #undef INTERNAL_SYSCALL_NCS -#define INTERNAL_SYSCALL_NCS(no, err, nr, args...) \ +#define INTERNAL_SYSCALL_NCS(no, nr, args...) \ ({ \ DECLARGS_##nr(args) \ register unsigned long int _nr __asm__("1") = (unsigned long int)(no); \ diff --git a/sysdeps/unix/sysv/linux/safe-fatal.h b/sysdeps/unix/sysv/linux/safe-fatal.h index 31432b5..62126d1 100644 --- a/sysdeps/unix/sysv/linux/safe-fatal.h +++ b/sysdeps/unix/sysv/linux/safe-fatal.h @@ -25,9 +25,8 @@ static inline void __safe_fatal (void) { - INTERNAL_SYSCALL_DECL (err); - pid_t self = INTERNAL_SYSCALL (getpid, err, 0); - INTERNAL_SYSCALL (kill, err, 2, self, SIGKILL); + pid_t self = INTERNAL_SYSCALL_CALL (getpid); + INTERNAL_SYSCALL_CALL (kill, self, SIGKILL); } #endif /* safe-fatal.h */ diff --git a/sysdeps/unix/sysv/linux/sh/sysdep.h b/sysdeps/unix/sysv/linux/sh/sysdep.h index c0e52af..60a5032 100644 --- a/sysdeps/unix/sysv/linux/sh/sysdep.h +++ b/sysdeps/unix/sysv/linux/sh/sysdep.h @@ -288,7 +288,7 @@ register long int r2 asm ("%r2") = (long int) (_arg7) #undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) \ +#define INTERNAL_SYSCALL(name, nr, args...) \ ({ \ unsigned long int resultvar; \ register long int r3 asm ("%r3") = SYS_ify (name); \ @@ -302,7 +302,7 @@ (int) resultvar; }) /* The _NCS variant allows non-constant syscall numbers. */ -#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ +#define INTERNAL_SYSCALL_NCS(name, nr, args...) \ ({ \ unsigned long int resultvar; \ register long int r3 asm ("%r3") = (name); \ diff --git a/sysdeps/unix/sysv/linux/shmat.c b/sysdeps/unix/sysv/linux/shmat.c index c11811a..3bc791c 100644 --- a/sysdeps/unix/sysv/linux/shmat.c +++ b/sysdeps/unix/sysv/linux/shmat.c @@ -31,15 +31,13 @@ shmat (int shmid, const void *shmaddr, int shmflg) #ifdef __ASSUME_DIRECT_SYSVIPC_SYSCALLS return (void*) INLINE_SYSCALL_CALL (shmat, shmid, shmaddr, shmflg); #else - INTERNAL_SYSCALL_DECL(err); unsigned long resultvar; void *raddr; - resultvar = INTERNAL_SYSCALL_CALL (ipc, err, IPCOP_shmat, shmid, shmflg, + resultvar = INTERNAL_SYSCALL_CALL (ipc, IPCOP_shmat, shmid, shmflg, &raddr, shmaddr); - if (INTERNAL_SYSCALL_ERROR_P (resultvar, err)) - return (void *) INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (resultvar, - err)); + if (INTERNAL_SYSCALL_ERROR_P (resultvar)) + return (void *) INLINE_SYSCALL_ERROR_RETURN_VALUE (INTERNAL_SYSCALL_ERRNO (resultvar)); return raddr; #endif diff --git a/sysdeps/unix/sysv/linux/sparc/sysdep.h b/sysdeps/unix/sysv/linux/sparc/sysdep.h index b14e132..aec4326 100644 --- a/sysdeps/unix/sysv/linux/sparc/sysdep.h +++ b/sysdeps/unix/sysv/linux/sparc/sysdep.h @@ -46,14 +46,14 @@ # define HAVE_GETTIMEOFDAY_VSYSCALL "__vdso_gettimeofday" #undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) \ - internal_syscall##nr(__SYSCALL_STRING, err, __NR_##name, args) +#define INTERNAL_SYSCALL(name, nr, args...) \ + internal_syscall##nr(__SYSCALL_STRING, __NR_##name, args) #undef INTERNAL_SYSCALL_NCS -#define INTERNAL_SYSCALL_NCS(name, err, nr, args...) \ - internal_syscall##nr(__SYSCALL_STRING, err, name, args) +#define INTERNAL_SYSCALL_NCS(name, nr, args...) \ + internal_syscall##nr(__SYSCALL_STRING, name, args) -#define internal_syscall0(string,err,name,dummy...) \ +#define internal_syscall0(string,name,dummy...) \ ({ \ register long int __g1 __asm__ ("g1") = (name); \ register long __o0 __asm__ ("o0"); \ @@ -63,7 +63,7 @@ __o0; \ }) -#define internal_syscall1(string,err,name,arg1) \ +#define internal_syscall1(string,name,arg1) \ ({ \ long int _arg1 = (long int) (arg1); \ register long int __g1 __asm__("g1") = (name); \ @@ -74,7 +74,7 @@ __o0; \ }) -#define internal_syscall2(string,err,name,arg1,arg2) \ +#define internal_syscall2(string,name,arg1,arg2) \ ({ \ long int _arg1 = (long int) (arg1); \ long int _arg2 = (long int) (arg2); \ @@ -87,7 +87,7 @@ __o0; \ }) -#define internal_syscall3(string,err,name,arg1,arg2,arg3) \ +#define internal_syscall3(string,name,arg1,arg2,arg3) \ ({ \ long int _arg1 = (long int) (arg1); \ long int _arg2 = (long int) (arg2); \ @@ -103,7 +103,7 @@ __o0; \ }) -#define internal_syscall4(string,err,name,arg1,arg2,arg3,arg4) \ +#define internal_syscall4(string,name,arg1,arg2,arg3,arg4) \ ({ \ long int _arg1 = (long int) (arg1); \ long int _arg2 = (long int) (arg2); \ @@ -121,7 +121,7 @@ __o0; \ }) -#define internal_syscall5(string,err,name,arg1,arg2,arg3,arg4,arg5) \ +#define internal_syscall5(string,name,arg1,arg2,arg3,arg4,arg5) \ ({ \ long int _arg1 = (long int) (arg1); \ long int _arg2 = (long int) (arg2); \ @@ -141,7 +141,7 @@ __o0; \ }) -#define internal_syscall6(string,err,name,arg1,arg2,arg3,arg4,arg5,arg6)\ +#define internal_syscall6(string,name,arg1,arg2,arg3,arg4,arg5,arg6) \ ({ \ long int _arg1 = (long int) (arg1); \ long int _arg2 = (long int) (arg2); \ diff --git a/sysdeps/unix/sysv/linux/sysdep-vdso.h b/sysdeps/unix/sysv/linux/sysdep-vdso.h index dc6eadd..a921549 100644 --- a/sysdeps/unix/sysv/linux/sysdep-vdso.h +++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h @@ -22,7 +22,7 @@ #include #ifndef INTERNAL_VSYSCALL_CALL -# define INTERNAL_VSYSCALL_CALL(funcptr, err, nr, args...) \ +# define INTERNAL_VSYSCALL_CALL(funcptr, nr, args...) \ funcptr (args) #endif @@ -30,24 +30,23 @@ ({ \ __label__ out; \ __label__ iserr; \ - INTERNAL_SYSCALL_DECL (sc_err); \ long int sc_ret; \ \ __typeof (GLRO(dl_vdso_##name)) vdsop = GLRO(dl_vdso_##name); \ if (vdsop != NULL) \ { \ - sc_ret = INTERNAL_VSYSCALL_CALL (vdsop, sc_err, nr, ##args); \ - if (!INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \ + sc_ret = INTERNAL_VSYSCALL_CALL (vdsop, nr, ##args); \ + if (!INTERNAL_SYSCALL_ERROR_P (sc_ret)) \ goto out; \ - if (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err) != ENOSYS) \ + if (INTERNAL_SYSCALL_ERRNO (sc_ret) != ENOSYS) \ goto iserr; \ } \ \ - sc_ret = INTERNAL_SYSCALL (name, sc_err, nr, ##args); \ - if (INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \ + sc_ret = INTERNAL_SYSCALL_CALL (name, ##args); \ + if (INTERNAL_SYSCALL_ERROR_P (sc_ret)) \ { \ iserr: \ - __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err)); \ + __set_errno (INTERNAL_SYSCALL_ERRNO (sc_ret)); \ sc_ret = -1L; \ } \ out: \ diff --git a/sysdeps/unix/sysv/linux/sysdep.h b/sysdeps/unix/sysv/linux/sysdep.h index ca3d84f..5e7b6c5 100644 --- a/sysdeps/unix/sysv/linux/sysdep.h +++ b/sysdeps/unix/sysv/linux/sysdep.h @@ -22,11 +22,8 @@ #include #include -#undef INTERNAL_SYSCALL_DECL -#define INTERNAL_SYSCALL_DECL(err) do { } while (0) - #undef INTERNAL_SYSCALL_ERROR_P -#define INTERNAL_SYSCALL_ERROR_P(val, err) \ +#define INTERNAL_SYSCALL_ERROR_P(val) \ ((unsigned long int) (val) > -4096UL) #ifndef SYSCALL_ERROR_LABEL @@ -43,15 +40,14 @@ #undef INLINE_SYSCALL #define INLINE_SYSCALL(name, nr, args...) \ ({ \ - INTERNAL_SYSCALL_DECL (sc_err); \ - long int sc_ret = INTERNAL_SYSCALL (name, sc_err, nr, args); \ - __glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (sc_ret, sc_err)) \ - ? SYSCALL_ERROR_LABEL (INTERNAL_SYSCALL_ERRNO (sc_ret, sc_err)) \ + long int sc_ret = INTERNAL_SYSCALL (name, nr, args); \ + __glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (sc_ret)) \ + ? SYSCALL_ERROR_LABEL (INTERNAL_SYSCALL_ERRNO (sc_ret)) \ : sc_ret; \ }) #undef INTERNAL_SYSCALL_ERRNO -#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val)) +#define INTERNAL_SYSCALL_ERRNO(val) (-(val)) /* Set error number and return -1. A target may choose to return the internal function, __syscall_error, which sets errno and returns -1. diff --git a/sysdeps/unix/sysv/linux/timer_create.c b/sysdeps/unix/sysv/linux/timer_create.c index b850a76..370c99a 100644 --- a/sysdeps/unix/sysv/linux/timer_create.c +++ b/sysdeps/unix/sysv/linux/timer_create.c @@ -148,11 +148,10 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid) ._sigev_un = { ._pad = { [0] = __helper_tid } } }; /* Create the timer. */ - INTERNAL_SYSCALL_DECL (err); int res; - res = INTERNAL_SYSCALL (timer_create, err, 3, - syscall_clockid, &sev, &newp->ktimerid); - if (! INTERNAL_SYSCALL_ERROR_P (res, err)) + res = INTERNAL_SYSCALL_CALL (timer_create, + syscall_clockid, &sev, &newp->ktimerid); + if (! INTERNAL_SYSCALL_ERROR_P (res)) { /* Add to the queue of active timers with thread delivery. */ @@ -168,7 +167,7 @@ timer_create (clockid_t clock_id, struct sigevent *evp, timer_t *timerid) /* Free the resources. */ free (newp); - __set_errno (INTERNAL_SYSCALL_ERRNO (res, err)); + __set_errno (INTERNAL_SYSCALL_ERRNO (res)); return -1; } diff --git a/sysdeps/unix/sysv/linux/timer_routines.c b/sysdeps/unix/sysv/linux/timer_routines.c index abafffd..00b7e01 100644 --- a/sysdeps/unix/sysv/linux/timer_routines.c +++ b/sysdeps/unix/sysv/linux/timer_routines.c @@ -47,8 +47,7 @@ timer_sigev_thread (void *arg) signals. */ sigset_t ss; sigemptyset (&ss); - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, &ss, NULL, _NSIG / 8); + INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_SETMASK, &ss, NULL, _NSIG / 8); struct thread_start_data *td = (struct thread_start_data *) arg; @@ -168,8 +167,7 @@ __start_helper_thread (void) sigset_t oss; sigfillset (&ss); __sigaddset (&ss, SIGCANCEL); - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, &ss, &oss, _NSIG / 8); + INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_SETMASK, &ss, &oss, _NSIG / 8); /* Create the helper thread for this timer. */ pthread_t th; @@ -179,8 +177,7 @@ __start_helper_thread (void) __helper_tid = ((struct pthread *) th)->tid; /* Restore the signal mask. */ - INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_SETMASK, &oss, NULL, - _NSIG / 8); + INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_SETMASK, &oss, NULL, _NSIG / 8); /* No need for the attribute anymore. */ (void) pthread_attr_destroy (&attr); diff --git a/sysdeps/unix/sysv/linux/times.c b/sysdeps/unix/sysv/linux/times.c index fee7f7e..e3db9cb 100644 --- a/sysdeps/unix/sysv/linux/times.c +++ b/sysdeps/unix/sysv/linux/times.c @@ -23,10 +23,9 @@ clock_t __times (struct tms *buf) { - INTERNAL_SYSCALL_DECL (err); - clock_t ret = INTERNAL_SYSCALL (times, err, 1, buf); - if (INTERNAL_SYSCALL_ERROR_P (ret, err) - && __builtin_expect (INTERNAL_SYSCALL_ERRNO (ret, err) == EFAULT, 0) + clock_t ret = INTERNAL_SYSCALL_CALL (times, buf); + if (INTERNAL_SYSCALL_ERROR_P (ret) + && __glibc_unlikely (INTERNAL_SYSCALL_ERRNO (ret) == EFAULT) && buf) { /* This might be an error or not. For architectures which have no diff --git a/sysdeps/unix/sysv/linux/x86/cpu-features.c b/sysdeps/unix/sysv/linux/x86/cpu-features.c index fcba2c0..d67b300 100644 --- a/sysdeps/unix/sysv/linux/x86/cpu-features.c +++ b/sysdeps/unix/sysv/linux/x86/cpu-features.c @@ -24,9 +24,7 @@ static inline int __attribute__ ((always_inline)) get_cet_status (void) { unsigned long long cet_status[3]; - INTERNAL_SYSCALL_DECL (err); - if (INTERNAL_SYSCALL (arch_prctl, err, 2, ARCH_CET_STATUS, - cet_status) == 0) + if (INTERNAL_SYSCALL_CALL (arch_prctl, ARCH_CET_STATUS, cet_status) == 0) return cet_status[0]; return 0; } diff --git a/sysdeps/unix/sysv/linux/x86/dl-cet.h b/sysdeps/unix/sysv/linux/x86/dl-cet.h index a5cd95f..9b2aaa2 100644 --- a/sysdeps/unix/sysv/linux/x86/dl-cet.h +++ b/sysdeps/unix/sysv/linux/x86/dl-cet.h @@ -22,14 +22,13 @@ static inline int __attribute__ ((always_inline)) dl_cet_allocate_legacy_bitmap (unsigned long *legacy_bitmap) { /* Allocate legacy bitmap. */ - INTERNAL_SYSCALL_DECL (err); #ifdef __LP64__ - return (int) INTERNAL_SYSCALL (arch_prctl, err, 2, - ARCH_CET_LEGACY_BITMAP, legacy_bitmap); + return (int) INTERNAL_SYSCALL_CALL (arch_prctl, + ARCH_CET_LEGACY_BITMAP, legacy_bitmap); #else unsigned long long legacy_bitmap_u64[2]; - int res = INTERNAL_SYSCALL (arch_prctl, err, 2, - ARCH_CET_LEGACY_BITMAP, legacy_bitmap_u64); + int res = INTERNAL_SYSCALL_CALL (arch_prctl, + ARCH_CET_LEGACY_BITMAP, legacy_bitmap_u64); if (res == 0) { legacy_bitmap[0] = legacy_bitmap_u64[0]; @@ -42,14 +41,12 @@ dl_cet_allocate_legacy_bitmap (unsigned long *legacy_bitmap) static inline int __attribute__ ((always_inline)) dl_cet_disable_cet (unsigned int cet_feature) { - INTERNAL_SYSCALL_DECL (err); - return (int) INTERNAL_SYSCALL (arch_prctl, err, 2, ARCH_CET_DISABLE, - cet_feature); + return (int) INTERNAL_SYSCALL_CALL (arch_prctl, ARCH_CET_DISABLE, + cet_feature); } static inline int __attribute__ ((always_inline)) dl_cet_lock_cet (void) { - INTERNAL_SYSCALL_DECL (err); - return (int) INTERNAL_SYSCALL (arch_prctl, err, 2, ARCH_CET_LOCK, 0); + return (int) INTERNAL_SYSCALL_CALL (arch_prctl, ARCH_CET_LOCK, 0); } diff --git a/sysdeps/unix/sysv/linux/x86_64/sysdep.h b/sysdeps/unix/sysv/linux/x86_64/sysdep.h index f641192..189c5fb 100644 --- a/sysdeps/unix/sysv/linux/x86_64/sysdep.h +++ b/sysdeps/unix/sysv/linux/x86_64/sysdep.h @@ -57,8 +57,10 @@ it here. */ # undef SYSCALL_ERROR_LABEL # ifdef PIC +# undef SYSCALL_ERROR_LABEL # define SYSCALL_ERROR_LABEL 0f # else +# undef SYSCALL_ERROR_LABEL # define SYSCALL_ERROR_LABEL syscall_error # endif @@ -190,15 +192,15 @@ #define ARGIFY(X) ((__typeof__ ((X) - (X))) (X)) #undef INTERNAL_SYSCALL -#define INTERNAL_SYSCALL(name, err, nr, args...) \ - internal_syscall##nr (SYS_ify (name), err, args) +#define INTERNAL_SYSCALL(name, nr, args...) \ + internal_syscall##nr (SYS_ify (name), args) #undef INTERNAL_SYSCALL_NCS -#define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ - internal_syscall##nr (number, err, args) +#define INTERNAL_SYSCALL_NCS(number, nr, args...) \ + internal_syscall##nr (number, args) #undef internal_syscall0 -#define internal_syscall0(number, err, dummy...) \ +#define internal_syscall0(number, dummy...) \ ({ \ unsigned long int resultvar; \ asm volatile ( \ @@ -210,7 +212,7 @@ }) #undef internal_syscall1 -#define internal_syscall1(number, err, arg1) \ +#define internal_syscall1(number, arg1) \ ({ \ unsigned long int resultvar; \ TYPEFY (arg1, __arg1) = ARGIFY (arg1); \ @@ -224,7 +226,7 @@ }) #undef internal_syscall2 -#define internal_syscall2(number, err, arg1, arg2) \ +#define internal_syscall2(number, arg1, arg2) \ ({ \ unsigned long int resultvar; \ TYPEFY (arg2, __arg2) = ARGIFY (arg2); \ @@ -240,7 +242,7 @@ }) #undef internal_syscall3 -#define internal_syscall3(number, err, arg1, arg2, arg3) \ +#define internal_syscall3(number, arg1, arg2, arg3) \ ({ \ unsigned long int resultvar; \ TYPEFY (arg3, __arg3) = ARGIFY (arg3); \ @@ -258,7 +260,7 @@ }) #undef internal_syscall4 -#define internal_syscall4(number, err, arg1, arg2, arg3, arg4) \ +#define internal_syscall4(number, arg1, arg2, arg3, arg4) \ ({ \ unsigned long int resultvar; \ TYPEFY (arg4, __arg4) = ARGIFY (arg4); \ @@ -278,7 +280,7 @@ }) #undef internal_syscall5 -#define internal_syscall5(number, err, arg1, arg2, arg3, arg4, arg5) \ +#define internal_syscall5(number, arg1, arg2, arg3, arg4, arg5) \ ({ \ unsigned long int resultvar; \ TYPEFY (arg5, __arg5) = ARGIFY (arg5); \ @@ -301,7 +303,7 @@ }) #undef internal_syscall6 -#define internal_syscall6(number, err, arg1, arg2, arg3, arg4, arg5, arg6) \ +#define internal_syscall6(number, arg1, arg2, arg3, arg4, arg5, arg6) \ ({ \ unsigned long int resultvar; \ TYPEFY (arg6, __arg6) = ARGIFY (arg6); \ diff --git a/sysdeps/unix/sysv/linux/x86_64/x32/times.c b/sysdeps/unix/sysv/linux/x86_64/x32/times.c index fb93cb6..864c123 100644 --- a/sysdeps/unix/sysv/linux/x86_64/x32/times.c +++ b/sysdeps/unix/sysv/linux/x86_64/x32/times.c @@ -20,7 +20,7 @@ /* Linux times system call returns 64-bit integer. */ #undef internal_syscall1 -#define internal_syscall1(number, err, arg1) \ +#define internal_syscall1(number, arg1) \ ({ \ unsigned long long int resultvar; \ TYPEFY (arg1, __arg1) = ARGIFY (arg1); \ @@ -34,7 +34,7 @@ }) #undef INTERNAL_SYSCALL_ERROR_P -#define INTERNAL_SYSCALL_ERROR_P(val, err) \ +#define INTERNAL_SYSCALL_ERROR_P(val) \ ((unsigned long long int) (val) >= -4095LL) #include -- cgit v1.1