[PATCH v2 2/2] manual: Document __libc_single_threaded

Florian Weimer fweimer@redhat.com
Tue Jun 30 08:56:22 GMT 2020


* Szabolcs Nagy:

> linux has several syscalls that change some property of
> the current thread and get inherited by new threads
> (e.g. setxid, various prctls, signal mask) and a user
> may want to set such property for the entire process
> and bail out if that cannot work, so the question is
> if __libc_single_threaded works for this? even if this
> is done in a signal handler? e.g.
>
> if (__libc_single_thread)
>   prctl(set_property,a2,a3,a4,a5); // entire process ok
> else
>   bailout(); // there might be other threads
>
> i think this may be another valid usage (not related
> to atomics).

In theory, that could be the case, but the question is what you do in
the bailout case.

Thanks,
Florian



More information about the Libc-alpha mailing list