[RFC] Add pthread_detach_pwd call.

Florian Weimer fweimer@redhat.com
Mon Oct 21 12:33:00 GMT 2013


On 10/21/2013 02:13 PM, Ondřej Bílka wrote:

>> I also don't see how we can actually implement something like
>> pthread_detach_pwd without adding and awful lot of wrappers.  It's
>> certainly not just open and fopen, but anything that expects a path
>> name.
>>
> I expected that there is only limited number of primitives that access
> internal structure.

Which internal structure?

>> (By the way, I think UID and GID are more problematic in this area.)
>>
>
> They are but per-thread behavior would probably require cooperation with
> kernel.

The kernel already keeps the IDs in a per-thread fashion.  We probably 
could add something like uselocale() so that threads could opt out of 
the global treatment.

Back in the LinuxThreads days, we actually had per-thread IDs, but since 
mutexes (or condition variables) sometimes involved signals, this didn't 
work all that well because you could get permission-related failures 
from pthread_* functions.  Futexes probably make this a lot simpler.

-- 
Florian Weimer / Red Hat Product Security Team



More information about the Libc-alpha mailing list