diff options
author | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-01-29 20:38:36 +0000 |
---|---|---|
committer | Adhemerval Zanella <adhemerval.zanella@linaro.org> | 2020-02-14 21:12:45 -0300 |
commit | bc2eb9321ec0d17d41596933617b2522c9aa5e0b (patch) | |
tree | 772961371ee718659d4a3f556fa5c9470123a2ed /nptl | |
parent | d1aea2805df2d9f5e06f8b508b377a8bc95ba335 (diff) | |
download | glibc-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 'nptl')
-rw-r--r-- | nptl/allocatestack.c | 12 | ||||
-rw-r--r-- | nptl/nptl-init.c | 26 | ||||
-rw-r--r-- | nptl/pthread_cancel.c | 7 | ||||
-rw-r--r-- | nptl/pthread_create.c | 10 | ||||
-rw-r--r-- | nptl/pthread_mutex_trylock.c | 11 | ||||
-rw-r--r-- | nptl/pthread_sigmask.c | 13 | ||||
-rw-r--r-- | nptl/thrd_yield.c | 3 |
7 files changed, 32 insertions, 50 deletions
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index 110ba18f5d..c94980c21c 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -1028,11 +1028,10 @@ setxid_signal_thread (struct xid_command *cmdp, struct pthread *t) int val; pid_t pid = __getpid (); - INTERNAL_SYSCALL_DECL (err); - val = INTERNAL_SYSCALL_CALL (tgkill, err, pid, t->tid, SIGSETXID); + val = INTERNAL_SYSCALL_CALL (tgkill, pid, t->tid, SIGSETXID); /* If this failed, it must have had not started yet or else exited. */ - if (!INTERNAL_SYSCALL_ERROR_P (val, err)) + if (!INTERNAL_SYSCALL_ERROR_P (val)) { atomic_increment (&cmdp->cntr); return 1; @@ -1158,13 +1157,12 @@ __nptl_setxid (struct xid_command *cmdp) /* This must be last, otherwise the current thread might not have permissions to send SIGSETXID syscall to the other threads. */ - INTERNAL_SYSCALL_DECL (err); - result = INTERNAL_SYSCALL_NCS (cmdp->syscall_no, err, 3, + result = INTERNAL_SYSCALL_NCS (cmdp->syscall_no, 3, cmdp->id[0], cmdp->id[1], cmdp->id[2]); int error = 0; - if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err))) + if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result))) { - error = INTERNAL_SYSCALL_ERRNO (result, err); + error = INTERNAL_SYSCALL_ERRNO (result); __set_errno (error); result = -1; } diff --git a/nptl/nptl-init.c b/nptl/nptl-init.c index 1877248014..6bc1e75f55 100644 --- a/nptl/nptl-init.c +++ b/nptl/nptl-init.c @@ -130,9 +130,8 @@ void __nptl_set_robust (struct pthread *self) { #ifdef __NR_set_robust_list - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL (set_robust_list, err, 2, &self->robust_head, - sizeof (struct robust_list_head)); + INTERNAL_SYSCALL_CALL (set_robust_list, &self->robust_head, + sizeof (struct robust_list_head)); #endif } @@ -203,12 +202,11 @@ sighandler_setxid (int sig, siginfo_t *si, void *ctx) || si->si_code != SI_TKILL) return; - INTERNAL_SYSCALL_DECL (err); - result = INTERNAL_SYSCALL_NCS (__xidcmd->syscall_no, err, 3, __xidcmd->id[0], + result = INTERNAL_SYSCALL_NCS (__xidcmd->syscall_no, 3, __xidcmd->id[0], __xidcmd->id[1], __xidcmd->id[2]); int error = 0; - if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result, err))) - error = INTERNAL_SYSCALL_ERRNO (result, err); + if (__glibc_unlikely (INTERNAL_SYSCALL_ERROR_P (result))) + error = INTERNAL_SYSCALL_ERRNO (result); __nptl_setxid_error (__xidcmd, error); /* Reset the SETXID flag. */ @@ -258,10 +256,9 @@ __pthread_initialize_minimal_internal (void) pd->robust_head.futex_offset = (offsetof (pthread_mutex_t, __data.__lock) - offsetof (pthread_mutex_t, __data.__list.__next)); - INTERNAL_SYSCALL_DECL (err); - int res = INTERNAL_SYSCALL (set_robust_list, err, 2, &pd->robust_head, - sizeof (struct robust_list_head)); - if (INTERNAL_SYSCALL_ERROR_P (res, err)) + int res = INTERNAL_SYSCALL_CALL (set_robust_list, &pd->robust_head, + sizeof (struct robust_list_head)); + if (INTERNAL_SYSCALL_ERROR_P (res)) #endif set_robust_list_not_avail (); } @@ -299,11 +296,8 @@ __pthread_initialize_minimal_internal (void) structure. It is already cleared. */ __sigaddset (&sa.sa_mask, SIGCANCEL); __sigaddset (&sa.sa_mask, SIGSETXID); - { - INTERNAL_SYSCALL_DECL (err); - (void) INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_UNBLOCK, &sa.sa_mask, - NULL, _NSIG / 8); - } + INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_UNBLOCK, &sa.sa_mask, + NULL, _NSIG / 8); /* Get the size of the static and alignment requirements for the TLS block. */ diff --git a/nptl/pthread_cancel.c b/nptl/pthread_cancel.c index 8e7be996e9..88c1ab8f6a 100644 --- a/nptl/pthread_cancel.c +++ b/nptl/pthread_cancel.c @@ -67,11 +67,10 @@ __pthread_cancel (pthread_t th) thread as canceled. */ pid_t pid = __getpid (); - INTERNAL_SYSCALL_DECL (err); - int val = INTERNAL_SYSCALL_CALL (tgkill, err, pid, pd->tid, + int val = INTERNAL_SYSCALL_CALL (tgkill, pid, pd->tid, SIGCANCEL); - if (INTERNAL_SYSCALL_ERROR_P (val, err)) - result = INTERNAL_SYSCALL_ERRNO (val, err); + if (INTERNAL_SYSCALL_ERROR_P (val)) + result = INTERNAL_SYSCALL_ERRNO (val); break; } diff --git a/nptl/pthread_create.c b/nptl/pthread_create.c index d3fd58730c..8614ec63f8 100644 --- a/nptl/pthread_create.c +++ b/nptl/pthread_create.c @@ -394,11 +394,10 @@ START_THREAD_DEFN if (__set_robust_list_avail >= 0) # endif { - INTERNAL_SYSCALL_DECL (err); /* This call should never fail because the initial call in init.c succeeded. */ - INTERNAL_SYSCALL (set_robust_list, err, 2, &pd->robust_head, - sizeof (struct robust_list_head)); + INTERNAL_SYSCALL_CALL (set_robust_list, &pd->robust_head, + sizeof (struct robust_list_head)); } #endif @@ -407,12 +406,11 @@ START_THREAD_DEFN cancellation signal mask. */ if (__glibc_unlikely (pd->parent_cancelhandling & CANCELING_BITMASK)) { - INTERNAL_SYSCALL_DECL (err); sigset_t mask; __sigemptyset (&mask); __sigaddset (&mask, SIGCANCEL); - (void) INTERNAL_SYSCALL (rt_sigprocmask, err, 4, SIG_UNBLOCK, &mask, - NULL, _NSIG / 8); + INTERNAL_SYSCALL_CALL (rt_sigprocmask, SIG_UNBLOCK, &mask, + NULL, _NSIG / 8); } /* This is where the try/finally block should be created. For diff --git a/nptl/pthread_mutex_trylock.c b/nptl/pthread_mutex_trylock.c index b9896f420e..2130f52529 100644 --- a/nptl/pthread_mutex_trylock.c +++ b/nptl/pthread_mutex_trylock.c @@ -297,13 +297,12 @@ __pthread_mutex_trylock (pthread_mutex_t *mutex) int private = (robust ? PTHREAD_ROBUST_MUTEX_PSHARED (mutex) : PTHREAD_MUTEX_PSHARED (mutex)); - INTERNAL_SYSCALL_DECL (__err); - int e = INTERNAL_SYSCALL (futex, __err, 4, &mutex->__data.__lock, - __lll_private_flag (FUTEX_TRYLOCK_PI, - private), 0, 0); + int e = INTERNAL_SYSCALL_CALL (futex, &mutex->__data.__lock, + __lll_private_flag (FUTEX_TRYLOCK_PI, + private), 0, 0); - if (INTERNAL_SYSCALL_ERROR_P (e, __err) - && INTERNAL_SYSCALL_ERRNO (e, __err) == EWOULDBLOCK) + if (INTERNAL_SYSCALL_ERROR_P (e) + && INTERNAL_SYSCALL_ERRNO (e) == EWOULDBLOCK) { /* The kernel has not yet finished the mutex owner death. We do not need to ensure ordering wrt another memory diff --git a/nptl/pthread_sigmask.c b/nptl/pthread_sigmask.c index 84eb189c81..c7860e02a5 100644 --- a/nptl/pthread_sigmask.c +++ b/nptl/pthread_sigmask.c @@ -39,16 +39,11 @@ pthread_sigmask (int how, const sigset_t *newmask, sigset_t *oldmask) newmask = &local_newmask; } -#ifdef INTERNAL_SYSCALL /* We know that realtime signals are available if NPTL is used. */ - INTERNAL_SYSCALL_DECL (err); - int result = INTERNAL_SYSCALL (rt_sigprocmask, err, 4, how, newmask, - oldmask, _NSIG / 8); + int result = INTERNAL_SYSCALL_CALL (rt_sigprocmask, how, newmask, + oldmask, _NSIG / 8); - return (INTERNAL_SYSCALL_ERROR_P (result, err) - ? INTERNAL_SYSCALL_ERRNO (result, err) + return (INTERNAL_SYSCALL_ERROR_P (result) + ? INTERNAL_SYSCALL_ERRNO (result) : 0); -#else - return sigprocmask (how, newmask, oldmask) == -1 ? errno : 0; -#endif } diff --git a/nptl/thrd_yield.c b/nptl/thrd_yield.c index 865f123d73..3e0fd46a27 100644 --- a/nptl/thrd_yield.c +++ b/nptl/thrd_yield.c @@ -21,6 +21,5 @@ void thrd_yield (void) { - INTERNAL_SYSCALL_DECL (err); - INTERNAL_SYSCALL_CALL (sched_yield, err); + INTERNAL_SYSCALL_CALL (sched_yield); } |