[23909] in Kerberos

home help back first fref pref prev next nref lref last post

Re: Problems running kinit on HP-UX 11.00, 11i

daemon@ATHENA.MIT.EDU (Roland Dowdeswell)
Tue May 17 23:43:52 2005

To: Sam Hartman <hartmans@mit.edu>
In-reply-to: Your message of "Tue, 17 May 2005 16:51:06 EDT."
             <tslmzqtr2yt.fsf@cz.mit.edu> 
Date: Tue, 17 May 2005 17:04:11 -0400
From: Roland Dowdeswell <elric@imrryr.org>
Message-Id: <20050517210411.6DAE737042@arioch.imrryr.org>
cc: kerberos@mit.edu
Errors-To: kerberos-bounces@mit.edu

On 1116363066 seconds since the Beginning of the UNIX epoch
Sam Hartman wrote:
>
>>>>>> "Roland" == Roland Dowdeswell <elric@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/
________________________________________________
Kerberos mailing list           Kerberos@mit.edu
https://mailman.mit.edu/mailman/listinfo/kerberos

home help back first fref pref prev next nref lref last post