This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Refactor Linux raise implementation (BZ#15368)


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."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]