[Swan] From Linux Fedora 18 crypt man - Issue with threads

Paul Wouters pwouters at redhat.com
Thu Mar 7 17:51:31 EET 2013


On Thu, 7 Mar 2013, Philippe Vouters wrote:

> ...
>       crypt_r() is a reentrant version of crypt().  The structure pointed 
> to
>       by  data  is  used  to  store  result data and bookkeeping 
> information.
>       Other than allocating it, the only thing that the caller should do 
> with
>       this  structure  is  to  set data->initialized to zero before the 
> first
>       call to crypt_r().

Yes, it is on my todo list. I've already gotten rid of localtime/gmtime
and used localtime_r/gmtime_r, and I'm going through the entire list of
functions noted not to be thread safe from "man pthreads".

However, it seems the biggest issue now are some of our own functions
that are not re-entrant that Hugh pointed out.

But I'll rewrite all the crypt() functions to use crypt_r() as well.

Paul


More information about the Swan mailing list