hadoop-common-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Patrick McCabe (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HADOOP-8569) CMakeLists.txt: define _GNU_SOURCE and _LARGEFILE_SOURCE
Date Mon, 09 Jul 2012 17:07:35 GMT

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

Colin Patrick McCabe commented on HADOOP-8569:

bq. The disadvantage is that libhdfs currently compiles on non-gnu systems and this breaks

Defining _GNU_SOURCE doesn't break the compile on any systems.  Nobody should be checking
for this macro except on Linux.  If they are, then that's a bug on their part, which we can
work around like this:


I guess maybe we should do it like that.  Although it shouldn't matter.

bq. What functions are we using that are currently being hidden that are only declared via
_gnu_source? If the above is true we should be able to use these via including std headers.

man sync_file_range
       sync_file_range - sync a file segment with disk

       #define _GNU_SOURCE         /* See feature_test_macros(7) */
       #include <fcntl.h>

       int sync_file_range(int fd, off64_t offset, off64_t nbytes,
                           unsigned int flags);

As you can see, the man page tells you to define _GNU_SOURCE in order to make this function
> CMakeLists.txt: define _GNU_SOURCE and _LARGEFILE_SOURCE
> --------------------------------------------------------
>                 Key: HADOOP-8569
>                 URL: https://issues.apache.org/jira/browse/HADOOP-8569
>             Project: Hadoop Common
>          Issue Type: Bug
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>            Priority: Minor
>         Attachments: HADOOP-8569.001.patch
> In the native code, we should define _GNU_SOURCE and _LARGEFILE_SOURCE so that all of
the functions on Linux are available.
> _LARGEFILE enables fseeko and ftello; _GNU_SOURCE enables a variety of Linux-specific
functions from glibc, including sync_file_range.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


View raw message