[PATCH] Check whether pthread_mutex_lock() and nanosleep() are included in libc before trying pthreads and rt

Stef Walter stefw at redhat.com
Mon Dec 2 06:30:56 PST 2013


On 30.11.2013 16:19, Nikos Mavrogiannopoulos wrote:
> On Thu, 2013-11-28 at 16:34 +0100, Nikos Mavrogiannopoulos wrote:
>> [resent]
>>
>> This is also related to:
>> https://bugzilla.redhat.com/show_bug.cgi?id=877421
>>
>> Although it's for gnutls the same argumentation applies :)
> 
> I realized that you use pthread_atfork() so anyway you need to link to
> libpthread. 
> 
> btw. Does p11-kit reinitialize automatically the modules after fork?

No, we just synchronize our internal state. Calling C_Initialize on in
pthread_atfork() is pretty wild. Most uses of fork() are fork/exec.
Besides not being async-signal-safe, many C_Initialize's are large
blocking pieces of code.

Anyway ... we expect the caller to C_Initialize after fork as they would
when using a PKCS#11 module without p11-kit. I know this doesn't solve
anything for gnutls, but it's not a trivial problem.

Cheers,

Stef



More information about the p11-glue mailing list