Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Feb 2003 23:30:38 -0800
From:      Lev Walkin <vlm@netli.com>
To:        Craig Rodrigues <rodrigc@attbi.com>
Cc:        freebsd-current@freebsd.org, freebsd-security@freebsd.org
Subject:   Re: OpenSSL question for id_function()
Message-ID:  <3E5DBE9E.7060302@netli.com>
In-Reply-To: <20030225155724.GB9400@attbi.com>
References:  <20030225155724.GB9400@attbi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Craig Rodrigues wrote:

>    return static_cast<unsigned long>(pthread_self());
> 
> pthread_self() returns something of type pthread_t.
> This code works under Linux, because pthread_t is mapped to an integer value.
> 
> However, on FreeBSD, pthread_t is a pointer to struct pthread, so this
> code does not compile:
> 
> OpenSSLPluginI.cpp: In function `long unsigned int IceSSL::idFunction()':
> OpenSSLPluginI.cpp:153: invalid static_cast from type `pthread*' to type `long
>    unsigned int'
> 
> 
> Is there a way to implement the id_function() for OpenSSL so that
> it works portably across FreeBSD and Linux?

return (unsigned long)(void *)(pthread_self());


-- 
Lev Walkin
vlm@netli.com


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3E5DBE9E.7060302>