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

This is a discussion on Re: Problems running kinit on HP-UX 11.00, 11i - Kerberos ; >>>>> "Roland" == Roland Dowdeswell 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 ...

+ Reply to Thread
Results 1 to 3 of 3

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

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

    >>>>> "Roland" == Roland Dowdeswell 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.

    ________________________________________________
    Kerberos mailing list Kerberos@mit.edu
    https://mailman.mit.edu/mailman/listinfo/kerberos


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

    On 1116363066 seconds since the Beginning of the UNIX epoch
    Sam Hartman wrote:
    >
    >>>>>> "Roland" == Roland Dowdeswell 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


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

    On May 17, 2005, at 17:04, Roland Dowdeswell wrote:
    > This condition can be reasonably easily detected via:

    [...]

    Yeah, add in a few weak-reference tests, and that's pretty much what I
    had in mind. But in the process of implementing this, probably a lot
    of the conditional code -- the "if pthreads is loaded do this,
    otherwise do this" bits -- will move into the support library so we
    don't wind up with this test replicated in a bunch of places through
    the libraries.

    Ken

    ________________________________________________
    Kerberos mailing list Kerberos@mit.edu
    https://mailman.mit.edu/mailman/listinfo/kerberos


+ Reply to Thread