[
https://issues.apache.org/jira/browse/HADOOP-7824?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14653086#comment-14653086
]
Vinayakumar B commented on HADOOP-7824:
---------------------------------------
After this, I started facing compile errors in NativeIO.c in windows, similar
to below,
{noformat} src\org\apache\hadoop\io\nativeio\NativeIO.c(145): error C2065:
'O_RDONLY' : undeclared identifier [C:\work\hadoop\mai
n\hadoop-common-project\hadoop-common\src\main\native\native.vcxproj]{noformat}
I am not JNI expert, but seeing the code change I understood that, from JNI
trying to set the value of the constant in the Java class. And this constant
name must be passed to {{SET_INT_OR_RETURN}}. So enclosing all these constants
names in quotes solved the compilation error for me. Just followed similar to
{{setStaticBoolean(env, clazz, "fadvisePossible", JNI_TRUE);}}
Please someone with JNI expertise confirm whether this changes are correct?
If so, I will raise a Jira and provide the patch to fix the compilation.
> NativeIO.java flags and identifiers must be set correctly for each platform,
> not hardcoded to their Linux values
> ----------------------------------------------------------------------------------------------------------------
>
> Key: HADOOP-7824
> URL: https://issues.apache.org/jira/browse/HADOOP-7824
> Project: Hadoop Common
> Issue Type: Sub-task
> Components: native
> Affects Versions: 0.20.204.0, 0.20.205.0, 1.0.3, 0.23.0, 2.0.0-alpha, 3.0.0
> Environment: Mac OS X, Linux, Solaris, Windows, ...
> Reporter: Dmytro Shteflyuk
> Assignee: Martin Walsh
> Labels: hadoop
> Fix For: 2.8.0
>
> Attachments: HADOOP-7824.001.patch, HADOOP-7824.002.patch,
> HADOOP-7824.003.patch, HADOOP-7824.004.patch, HADOOP-7824.patch,
> HADOOP-7824.patch, hadoop-7824.txt
>
>
> NativeIO.java flags and identifiers must be set correctly for each platform,
> not hardcoded to their Linux values. Constants like O_CREAT, O_EXCL, etc.
> have different values on OS X and many other operating systems.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)