[
https://issues.apache.org/jira/browse/HADOOP-11638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14349341#comment-14349341
]
Kiran Kumar M R commented on HADOOP-11638:
------------------------------------------
Attached 003 patch with Solaris specific code.
{code}
#elif defined(__sun)
thread_id = (unsigned long)pthread_self();
{code}
Checked Solaris threading documentation
http://docs.oracle.com/cd/E19455-01/806-5257/6je9h033p/index.html
{{thr_self}} and {{pthread_self}} are same, document says "you can safely mix
Solaris threads functions and pthread functions in the same program"
We can go ahead with {{pthread_self}}. No need to use {{thr_self}}, as this
needs new include file {{#include <thread.h>}}.
[~cmccabe], If Solaris support is needed, use 003 patch else 002 should be fine.
> Linux-specific gettid() used in OpensslSecureRandom.c
> -----------------------------------------------------
>
> Key: HADOOP-11638
> URL: https://issues.apache.org/jira/browse/HADOOP-11638
> Project: Hadoop Common
> Issue Type: Bug
> Components: native
> Affects Versions: 2.6.0
> Reporter: Dmitry Sivachenko
> Assignee: Kiran Kumar M R
> Labels: freebsd
> Attachments: HADOOP-11638-001.patch, HADOOP-11638-002.patch,
> HADOOP-11638-003.patch
>
>
> In OpensslSecureRandom.c you use Linux-specific syscall gettid():
> static unsigned long pthreads_thread_id(void)
> {
> return (unsigned long)syscall(SYS_gettid);
> }
> Man page says:
> gettid() is Linux-specific and should not be used in programs that are
> intended to be portable.
> This breaks hadoop-2.6.0 compilation on FreeBSD (may be on other OSes too).
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)