about summary refs log tree commit diff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-01-29 20:38:36 +0000
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2020-02-14 21:12:45 -0300
commitbc2eb9321ec0d17d41596933617b2522c9aa5e0b (patch)
tree772961371ee718659d4a3f556fa5c9470123a2ed /sysdeps/unix/sysv
parentd1aea2805df2d9f5e06f8b508b377a8bc95ba335 (diff)
downloadglibc-bc2eb9321ec0d17d41596933617b2522c9aa5e0b.tar.gz
glibc-bc2eb9321ec0d17d41596933617b2522c9aa5e0b.tar.xz
glibc-bc2eb9321ec0d17d41596933617b2522c9aa5e0b.zip
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.
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/linux/aarch64/sysdep.h14
-rw-r--r--sysdeps/unix/sysv/linux/aio_misc.h9
-rw-r--r--sysdeps/unix/sysv/linux/alpha/fxstat.c13
-rw-r--r--sysdeps/unix/sysv/linux/alpha/fxstatat.c7
-rw-r--r--sysdeps/unix/sysv/linux/alpha/lxstat.c13
-rw-r--r--sysdeps/unix/sysv/linux/alpha/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/alpha/xstat.c13
-rw-r--r--sysdeps/unix/sysv/linux/arm/dl-machine.h2
-rw-r--r--sysdeps/unix/sysv/linux/arm/sysdep.h12
-rw-r--r--sysdeps/unix/sysv/linux/arm/tls.h7
-rw-r--r--sysdeps/unix/sysv/linux/clock_getcpuclockid.c9
-rw-r--r--sysdeps/unix/sysv/linux/clock_nanosleep.c22
-rw-r--r--sysdeps/unix/sysv/linux/createthread.c19
-rw-r--r--sysdeps/unix/sysv/linux/csky/sysdep.h24
-rw-r--r--sysdeps/unix/sysv/linux/default-sched.h6
-rw-r--r--sysdeps/unix/sysv/linux/dl-origin.c7
-rw-r--r--sysdeps/unix/sysv/linux/dl-writev.h3
-rw-r--r--sysdeps/unix/sysv/linux/exit-thread.h3
-rw-r--r--sysdeps/unix/sysv/linux/fcntl_nocancel.c7
-rw-r--r--sysdeps/unix/sysv/linux/fxstatat.c9
-rw-r--r--sysdeps/unix/sysv/linux/fxstatat64.c13
-rw-r--r--sysdeps/unix/sysv/linux/generic/____longjmp_chk.c3
-rw-r--r--sysdeps/unix/sysv/linux/generic/brk.c4
-rw-r--r--sysdeps/unix/sysv/linux/generic/dl-origin.c7
-rw-r--r--sysdeps/unix/sysv/linux/hppa/____longjmp_chk.c5
-rw-r--r--sysdeps/unix/sysv/linux/hppa/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/i386/brk.c3
-rw-r--r--sysdeps/unix/sysv/linux/i386/fxstat.c8
-rw-r--r--sysdeps/unix/sysv/linux/i386/fxstatat.c8
-rw-r--r--sysdeps/unix/sysv/linux/i386/lxstat.c8
-rw-r--r--sysdeps/unix/sysv/linux/i386/sysdep.h58
-rw-r--r--sysdeps/unix/sysv/linux/i386/xstat.c8
-rw-r--r--sysdeps/unix/sysv/linux/ia64/__sigstack_longjmp.c3
-rw-r--r--sysdeps/unix/sysv/linux/ia64/sysdep.h8
-rw-r--r--sysdeps/unix/sysv/linux/ifaddrs.c3
-rw-r--r--sysdeps/unix/sysv/linux/internal-signals.h9
-rw-r--r--sysdeps/unix/sysv/linux/libc_fatal.c7
-rw-r--r--sysdeps/unix/sysv/linux/m68k/____longjmp_chk.c5
-rw-r--r--sysdeps/unix/sysv/linux/m68k/brk.c3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/coldfire/atomic-machine.h2
-rw-r--r--sysdeps/unix/sysv/linux/m68k/getpagesize.c5
-rw-r--r--sysdeps/unix/sysv/linux/m68k/m68k-helpers.c3
-rw-r--r--sysdeps/unix/sysv/linux/m68k/sysdep.h6
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/brk.c4
-rw-r--r--sysdeps/unix/sysv/linux/microblaze/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/mips/brk.c3
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips32/sysdep.h10
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c7
-rw-r--r--sysdeps/unix/sysv/linux/mips/mips64/sysdep.h29
-rw-r--r--sysdeps/unix/sysv/linux/mq_unlink.c7
-rw-r--r--sysdeps/unix/sysv/linux/nios2/sysdep.h10
-rw-r--r--sysdeps/unix/sysv/linux/not-cancel.h3
-rw-r--r--sysdeps/unix/sysv/linux/not-errno.h16
-rw-r--r--sysdeps/unix/sysv/linux/nscd_setup_thread.c7
-rw-r--r--sysdeps/unix/sysv/linux/personality.c7
-rw-r--r--sysdeps/unix/sysv/linux/posix_fadvise.c11
-rw-r--r--sysdeps/unix/sysv/linux/posix_fadvise64.c9
-rw-r--r--sysdeps/unix/sysv/linux/posix_fallocate.c9
-rw-r--r--sysdeps/unix/sysv/linux/posix_fallocate64.c15
-rw-r--r--sysdeps/unix/sysv/linux/posix_madvise.c5
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/get_timebase_freq.c3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_mask.c3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc32/fpu/fe_nomask.c3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_mask.c3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/powerpc64/fpu/fe_nomask.c3
-rw-r--r--sysdeps/unix/sysv/linux/powerpc/sysdep.h12
-rw-r--r--sysdeps/unix/sysv/linux/pthread-pids.h3
-rw-r--r--sysdeps/unix/sysv/linux/pthread_getaffinity.c9
-rw-r--r--sysdeps/unix/sysv/linux/pthread_kill.c8
-rw-r--r--sysdeps/unix/sysv/linux/pthread_setaffinity.c11
-rw-r--r--sysdeps/unix/sysv/linux/pthread_sigqueue.c8
-rw-r--r--sysdeps/unix/sysv/linux/raise.c7
-rw-r--r--sysdeps/unix/sysv/linux/riscv/syscall.c5
-rw-r--r--sysdeps/unix/sysv/linux/riscv/sysdep.h24
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/____longjmp_chk.c5
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/posix_fadvise64.c7
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/____longjmp_chk.c5
-rw-r--r--sysdeps/unix/sysv/linux/s390/s390-64/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/s390/sysdep.h6
-rw-r--r--sysdeps/unix/sysv/linux/safe-fatal.h5
-rw-r--r--sysdeps/unix/sysv/linux/sh/sysdep.h4
-rw-r--r--sysdeps/unix/sysv/linux/shmat.c8
-rw-r--r--sysdeps/unix/sysv/linux/sparc/sysdep.h22
-rw-r--r--sysdeps/unix/sysv/linux/sysdep-vdso.h15
-rw-r--r--sysdeps/unix/sysv/linux/sysdep.h14
-rw-r--r--sysdeps/unix/sysv/linux/timer_create.c9
-rw-r--r--sysdeps/unix/sysv/linux/timer_routines.c9
-rw-r--r--sysdeps/unix/sysv/linux/times.c7
-rw-r--r--sysdeps/unix/sysv/linux/x86/cpu-features.c4
-rw-r--r--sysdeps/unix/sysv/linux/x86/dl-cet.h17
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/sysdep.h24
-rw-r--r--sysdeps/unix/sysv/linux/x86_64/x32/times.c4
93 files changed, 360 insertions, 457 deletions
diff --git a/sysdeps/unix/sysv/linux/aarch64/sysdep.h b/sysdeps/unix/sysv/linux/aarch64/sysdep.h
index 79fa0bda27..319a7c7ac5 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 42849ab74c..30c3cd778e 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 d10e0ac2de..0978610bf0 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 4d2815ade0..c5953d250a 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 bb2baf0ad9..eb03a5fbfe 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 f5bcd851f0..7daf445068 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 aa45c7df69..3ba1ae1811 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 5fc685fdaf..a307326e9c 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 f6e6b63959..e2985cffd7 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 18afe244d7..1b520c6802 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 97fa9cc496..be1f477187 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 728137aa56..48175ef1da 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 33e5f5dbbb..21f9d24f2d 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 7ebb19dce8..7e8e89dd42 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 26fe9ec6e6..6db3e3ba46 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 74c8ff142b..515ed6fc8c 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 c04d1a74a8..3dd8376385 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 083e4620d9..d617594bfd 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 bafc1cff5f..ed9211001f 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 524d5a6df6..3eb898e322 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 c0f1035652..e24b456604 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 634101a1cd..9be49ad91c 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 2bfe5f2e39..40a80ab970 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 9d3c639a7c..1ab02bbf10 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 d77db64a54..eae0a7fe31 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 88e368db4d..7f8da30d23 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 b0e5b0f85c..021b6d37a0 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 8eda42f2e6..db59baa71b 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 d510d7463d..f720f6e429 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 e6f8e0fbca..e960077893 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 2387a4a144..5e3888060b 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 3557a91394..96f67168ac 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 85a8714c4d..6e16651fd0 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 8b2ff9cabb..ed279afdfd 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 ccacbfdb16..8ab73a7422 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 bc2f23aea4..e958522a07 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 5097f41dc8..7e22c0fc32 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 28b0ee08c1..1e9c5259ab 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 6ce2f2553c..ee88acbdc4 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 53c30be802..ea05b00357 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 ad6559320e..b57a03f7d3 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 f3bb727d02..62809e3f5a 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 e3d87be18b..3e0ab605de 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 4dd5b76079..20c3e625e4 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 8f9355fdd9..d500172114 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 4ec2a43bc8..0335837948 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 7c04819f6c..c5bcd90c25 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 <mips16-syscall.h>
 
-# 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 6d36adab05..cd495a3337 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 112d940dd7..1882fe4e73 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 a0c3348744..4ea882da86 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 45ef817ab5..dbd23b814a 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 df6023a1de..bf09a3d6b8 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 cdc9d9b492..394dabeb93 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 6e14918be0..fe77704d1f 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 970bd7becd..e45fffa1c2 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 63965dddbd..bada96b697 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 c0fa6e3391..9787ab4c7c 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 7af973be9e..7238b00038 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 ce8de713d5..2de63ac277 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 daff027aac..0e49f3b7ac 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 81f7c73f38..279b86e0da 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 61164f21df..1a047fb7ff 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 6ee75f6324..1c40cd36d6 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 61fd3b0181..02ed0a66ae 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 f4febe7603..33a36e2673 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 94428396a3..fd79bbcf3c 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 50c022ead2..0b8ca4ec06 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 a3d5856763..cf6ecfe01f 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 1d63100b33..4dfe08ffcd 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 746824c79f..264d677c29 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 52d815a399..4b32be2d64 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 4c9f3fad8b..3b90ae1d55 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 9d0e4175dd..a99375c054 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 e46160f3f6..83e4adf6a2 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 28fa16fe4e..1f214173fe 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 c9847796f4..b556a6caae 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, &parameters);
-  if (!INTERNAL_SYSCALL_ERROR_P (ret, err))
+  int ret = INTERNAL_SYSCALL_CALL (fadvise64_64, &parameters);
+  if (!INTERNAL_SYSCALL_ERROR_P (ret))
     return 0;
-  return INTERNAL_SYSCALL_ERRNO (ret, err);
+  return INTERNAL_SYSCALL_ERRNO (ret);
 }
 
 #include <shlib-compat.h>
diff --git a/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h b/sysdeps/unix/sysv/linux/s390/s390-32/sysdep.h
index 98e5ba02f6..26b0410cf3 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 1305c81421..bc74408135 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 2a4874c610..c761a63030 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 e0e25c9352..e392960592 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 31432b5bf7..62126d1195 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 c0e52af65a..60a5032ce4 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 c11811ae17..3bc791c05f 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 b14e13299e..aec4326cc9 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 dc6eaddbbf..a9215494dc 100644
--- a/sysdeps/unix/sysv/linux/sysdep-vdso.h
+++ b/sysdeps/unix/sysv/linux/sysdep-vdso.h
@@ -22,7 +22,7 @@
 #include <ldsodefs.h>
 
 #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 ca3d84f66b..5e7b6c5765 100644
--- a/sysdeps/unix/sysv/linux/sysdep.h
+++ b/sysdeps/unix/sysv/linux/sysdep.h
@@ -22,11 +22,8 @@
 #include <kernel-features.h>
 #include <errno.h>
 
-#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 b850a7631e..370c99a517 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 abafffdfd5..00b7e018ba 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 fee7f7eee3..e3db9cb400 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 fcba2c000d..d67b300595 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 a5cd95f4c3..9b2aaa238c 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 f6411925ae..189c5fb327 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 fb93cb609c..864c123117 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 <sysdeps/unix/sysv/linux/times.c>