hadoop-common-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koji Noguchi (JIRA)" <j...@apache.org>
Subject [jira] Updated: (HADOOP-2880) libhdfs: O_WRONLY/O_RDONLY different when including fcntl.h
Date Fri, 22 Feb 2008 16:29:19 GMT

     [ https://issues.apache.org/jira/browse/HADOOP-2880?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Koji Noguchi updated HADOOP-2880:
---------------------------------

       Priority: Minor  (was: Major)
    Description: 
In hdfs.h, 

#ifndef O_RDONLY
#define O_RDONLY 1
#endif

#ifndef O_WRONLY
#define O_WRONLY 2
#endif

but on linux, 

$ grep "define O_RDONLY" /usr/include/*/*
/usr/include/asm-i386/fcntl.h:#define O_RDONLY       00
/usr/include/asm-x86_64/fcntl.h:#define O_RDONLY             00
/usr/include/bits/fcntl.h:#define O_RDONLY           00

$ grep "define O_WRONLY" /usr/include/*/*
/usr/include/asm-i386/fcntl.h:#define O_WRONLY       01
/usr/include/asm-x86_64/fcntl.h:#define O_WRONLY             01
/usr/include/bits/fcntl.h:#define O_WRONLY           01


It took me a while to debug when hdfsOpenFile was trying to 'write' when I meant 'read'.


  was:
In hdfs.h, 

#ifndef O_RDONLY
#define O_RDONLY 1
#endif

#ifndef O_WRONLY
#define O_WRONLY 2
#endif

but on linux, 

$ grep "define O_RDONLY" /usr/include/*/*
/usr/include/asm-i386/fcntl.h:#define O_RDONLY       00
/usr/include/asm-x86_64/fcntl.h:#define O_RDONLY             00
/usr/include/bits/fcntl.h:#define O_RDONLY           00

[knoguchi@ucdev12 ~]$ grep "define O_WRONLY" /usr/include/*/*
/usr/include/asm-i386/fcntl.h:#define O_WRONLY       01
/usr/include/asm-x86_64/fcntl.h:#define O_WRONLY             01
/usr/include/bits/fcntl.h:#define O_WRONLY           01


It took me a while to debug when hdfsOpenFile was trying to 'write' when I meant 'read'.



> libhdfs: O_WRONLY/O_RDONLY different when including fcntl.h
> -----------------------------------------------------------
>
>                 Key: HADOOP-2880
>                 URL: https://issues.apache.org/jira/browse/HADOOP-2880
>             Project: Hadoop Core
>          Issue Type: Bug
>          Components: libhdfs
>         Environment: linux
>            Reporter: Koji Noguchi
>            Priority: Minor
>
> In hdfs.h, 
> #ifndef O_RDONLY
> #define O_RDONLY 1
> #endif
> #ifndef O_WRONLY
> #define O_WRONLY 2
> #endif
> but on linux, 
> $ grep "define O_RDONLY" /usr/include/*/*
> /usr/include/asm-i386/fcntl.h:#define O_RDONLY       00
> /usr/include/asm-x86_64/fcntl.h:#define O_RDONLY             00
> /usr/include/bits/fcntl.h:#define O_RDONLY           00
> $ grep "define O_WRONLY" /usr/include/*/*
> /usr/include/asm-i386/fcntl.h:#define O_WRONLY       01
> /usr/include/asm-x86_64/fcntl.h:#define O_WRONLY             01
> /usr/include/bits/fcntl.h:#define O_WRONLY           01
> It took me a while to debug when hdfsOpenFile was trying to 'write' when I meant 'read'.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message