[ 
https://issues.apache.org/jira/browse/HADOOP-11638?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14343533#comment-14343533
 ] 

Colin Patrick McCabe commented on HADOOP-11638:
-----------------------------------------------

bq. I don't quite understand the code here: do you really need gettid() here or 
it can be replaced with pthread_self()?

{{pthread_self}} returns an opaque identifier.  On many platforms, this is not 
a {{long}}.  Since the {{pthreads_thread_id}} function requires a {{long}}, 
{{pthread_self}} will not do.  The fix is going to have to be 
platform-specific.  I don't know what it would be for OpenBSD but maybe someone 
here does.

> 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
>
> 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)

Reply via email to