Problems running kinit on HP-UX 11.00, 11i

Roland Dowdeswell elric at imrryr.org
Tue May 17 17:04:11 EDT 2005


On 1116363066 seconds since the Beginning of the UNIX epoch
Sam Hartman wrote:
>
>>>>>> "Roland" == Roland Dowdeswell <elric at imrryr.org> writes:
>
>    Roland> On 1116021302 seconds since the Beginning of the UNIX
>    Roland> epoch
>    Roland> Sam Hartman wrote:
>    >>
>
>    >> A design can be broken.
>    >> 
>    >> I don't believe the implementation of pthread_once in the HP
>    >> libc meets the API specification in POSIX.  That counts as
>    >> broken in my book.
>
>    Roland> Looks like SunOS 5.7 provides a pthread_once() that
>    Roland> returns true without calling anything if -lpthread is not
>    Roland> specified.  We probably need a more generic solution...
>
>Yep.  Ken is looking into this.

This condition can be reasonably easily detected via:

static void		set_has_pthread_once(void);
static inline int	has_pthread_once_func(void);

int has_pthread_once = 0;

static void
set_has_pthread_once(void)
{

	has_pthread_once = 1;
}

static inline int
has_pthread_once_func(void)
{
	pthread_once_t once_control = PTHREAD_ONCE_INIT;

	if (has_pthread_once)
		return 1;
	pthread_once(&once_control, set_has_pthread_once);
	return has_pthread_once;
}

or some such.  Although, it would probably make the code less full
of #ifdef's to simply implement krb5_pthread_once() which doesn't
use pthread_once() but simply manages its own mutex's.

--
    Roland Dowdeswell                      http://www.Imrryr.ORG/~elric/


More information about the Kerberos mailing list