[PATCH] Refactor Linux raise implementation (BZ#15368)
Andreas Schwab
schwab@suse.de
Thu Jul 7 15:30:00 GMT 2016
Adhemerval Zanella <adhemerval.zanella@linaro.org> writes:
> + /* raise is an async-safe function so it could be called while the
> + fork/vfork function temporarily invalidated the PID field. To avoid
> + relying in the cached value we block all user-defined signal handler
> + (which might call fork/vfork) and issues the getpid and gettid
> + directly. */
s/issues/issue/; s/^/ syscalls/
> + 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);
> +
> + int ret = INLINE_SYSCALL (tgkill, 3, pid, tid, sig);
> +
> + __libc_signal_restore_set (&set);
What if block/unblock fail?
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
More information about the Libc-alpha
mailing list