From owner-freebsd-threads@FreeBSD.ORG Wed May 28 16:51:18 2003 Return-Path: Delivered-To: freebsd-threads@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B340137B401 for ; Wed, 28 May 2003 16:51:18 -0700 (PDT) Received: from h00609772adf0.ne.client2.attbi.com (h00609772adf0.ne.client2.attbi.com [24.61.43.152]) by mx1.FreeBSD.org (Postfix) with ESMTP id A98FF43F93 for ; Wed, 28 May 2003 16:51:12 -0700 (PDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: from h00609772adf0.ne.client2.attbi.com (localhost.ne.attbi.com [127.0.0.1])h4SNpLSr003510 for ; Wed, 28 May 2003 19:51:21 -0400 (EDT) (envelope-from rodrigc@h00609772adf0.ne.client2.attbi.com) Received: (from rodrigc@localhost)h4SNpLiY003509 for freebsd-threads@freebsd.org; Wed, 28 May 2003 19:51:21 -0400 (EDT) Date: Wed, 28 May 2003 19:51:20 -0400 From: Craig Rodrigues To: freebsd-threads@freebsd.org Message-ID: <20030528235120.GA3481@attbi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i Subject: Question about OpenSSL id_function() and pthreads X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2003 23:51:19 -0000 Hi, I previously asked this question on freebsd-security@ and freebsd-current@ : http://docs.freebsd.org/cgi/getmsg.cgi?fetch=63674+0+archive/2003/freebsd-security/20030302.freebsd-security Let me try again, now that there is a freebsd-threads mailing list. On the following OpenSSL web page: http://www.openssl.org/docs/crypto/threads.html "void CRYPTO_set_id_callback(unsigned long (*id_function)(void)); id_function(void) is a function that returns a thread ID. It is not needed on Windows nor on platforms where getpid() returns a different ID for each thread (most notably Linux)." I have some third party C++ code which tries to implements this function: tatic unsigned long idFunction() { #ifdef _WIN32 return static_cast(GetCurrentThreadId()); #else return static_cast(pthread_self()); #endif } This code does not compile on FreeBSD-CURRENT: OpenSSLPluginI.cpp: In function `long unsigned int idFunction()': OpenSSLPluginI.cpp:151: invalid static_cast from type `pthread*' to type `long unsigned int' How can I implement this function properly on FreeBSD? Thanks. -- Craig Rodrigues http://home.attbi.com/~rodrigc rodrigc@attbi.com