Return-Path: X-Original-To: apmail-hadoop-common-commits-archive@www.apache.org Delivered-To: apmail-hadoop-common-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 81F9317EC3 for ; Tue, 17 Mar 2015 20:25:54 +0000 (UTC) Received: (qmail 15350 invoked by uid 500); 17 Mar 2015 20:25:21 -0000 Delivered-To: apmail-hadoop-common-commits-archive@hadoop.apache.org Received: (qmail 15016 invoked by uid 500); 17 Mar 2015 20:25:21 -0000 Mailing-List: contact common-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: common-dev@hadoop.apache.org Delivered-To: mailing list common-commits@hadoop.apache.org Received: (qmail 12058 invoked by uid 99); 17 Mar 2015 20:25:19 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 17 Mar 2015 20:25:19 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id EB351E1883; Tue, 17 Mar 2015 20:25:18 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: cmccabe@apache.org To: common-commits@hadoop.apache.org Date: Tue, 17 Mar 2015 20:25:49 -0000 Message-Id: <862f696a3c83400d8ed7942d08a884a6@git.apache.org> In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [32/50] [abbrv] hadoop git commit: HADOOP-11638. OpensslSecureRandom.c pthreads_thread_id should support FreeBSD and Solaris in addition to Linux. Contributed by Kiran Kumar M R. HADOOP-11638. OpensslSecureRandom.c pthreads_thread_id should support FreeBSD and Solaris in addition to Linux. Contributed by Kiran Kumar M R. Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/72cd4e4a Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/72cd4e4a Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/72cd4e4a Branch: refs/heads/HDFS-7836 Commit: 72cd4e4a4eb2a9f8695d4c67eb55dd2be36c52dc Parents: 685dbaf Author: cnauroth Authored: Mon Mar 16 13:26:57 2015 -0700 Committer: cnauroth Committed: Mon Mar 16 14:04:40 2015 -0700 ---------------------------------------------------------------------- hadoop-common-project/hadoop-common/CHANGES.txt | 3 +++ .../hadoop/crypto/random/OpensslSecureRandom.c | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hadoop/blob/72cd4e4a/hadoop-common-project/hadoop-common/CHANGES.txt ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/CHANGES.txt b/hadoop-common-project/hadoop-common/CHANGES.txt index aa17841..2a2b916 100644 --- a/hadoop-common-project/hadoop-common/CHANGES.txt +++ b/hadoop-common-project/hadoop-common/CHANGES.txt @@ -1105,6 +1105,9 @@ Release 2.7.0 - UNRELEASED HADOOP-11558. Fix dead links to doc of hadoop-tools. (Jean-Pierre Matsumoto via ozawa) + HADOOP-11638. OpensslSecureRandom.c pthreads_thread_id should support FreeBSD + and Solaris in addition to Linux. (Kiran Kumar M R via cnauroth) + Release 2.6.1 - UNRELEASED INCOMPATIBLE CHANGES http://git-wip-us.apache.org/repos/asf/hadoop/blob/72cd4e4a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c ---------------------------------------------------------------------- diff --git a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c index 6c31d10..8f0c06d 100644 --- a/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c +++ b/hadoop-common-project/hadoop-common/src/main/native/src/org/apache/hadoop/crypto/random/OpensslSecureRandom.c @@ -29,6 +29,10 @@ #include #endif +#if defined(__FreeBSD__) +#include +#endif + #ifdef WINDOWS #include #endif @@ -274,7 +278,19 @@ static void pthreads_locking_callback(int mode, int type, char *file, int line) static unsigned long pthreads_thread_id(void) { - return (unsigned long)syscall(SYS_gettid); + unsigned long thread_id = 0; +#if defined(__linux__) + thread_id = (unsigned long)syscall(SYS_gettid); +#elif defined(__FreeBSD__) + thread_id = (unsigned long)pthread_getthreadid_np(); +#elif defined(__sun) + thread_id = (unsigned long)pthread_self(); +#elif defined(__APPLE__) + (void)pthread_threadid_np(pthread_self(), &thread_id); +#else +#error "Platform not supported" +#endif + return thread_id; } #endif /* UNIX */