This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug manual/6911] New: "GNU system" is ambiguous
- From: "siward at wanadoo dot nl" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: 22 Sep 2008 19:23:42 -0000
- Subject: [Bug manual/6911] New: "GNU system" is ambiguous
- Reply-to: sourceware-bugzilla at sourceware dot org
Hello everyone,
in manual, in section about file-acces modes,
below description of O_RDWR :
"In GNU system (and not in other systems),
O_RDONLY and O_WRONLY are independent bits that can be bitwise-ORed together,
and it is valid for either bit to be set or clear.
This means that O_RDWR is same as `O_RDONLY|O_WRONLY'."
I thought this was clear,
that 'GNU system' refers to
GNU's systematic ways of creating C library.
So, since i
#define __USE_GNU
#define _GNU_SOURCE
i thought i could use O_RDONLY|O_WRONLY where i wanted rw access.
However, then my program failed in mysterious ways
(because in one part i used O_RDONLY|O_WRONLY,
while in an included file i used O_RDWR).
So i tested values of these macros from inside program,
and found :
O_RDONLY=0 O_WRONLY=1 O_RDWR=2 O_CREAT=64
Grepping through includefiles, i think these are from
/usr/include/bits/fcntl.h or
/usr/include/asm-generic/fcntl.h ,
both of which set O_RDONLY to 0,
and i think latter one is from GNU libc
(i got them both from Debian unstable).
Now there are multiple possibilities as to what is this bug :
1) manual means GNU Hurd when it says "GNU system".
2) manual is incorrect in this case.
3) includefiles are incorrect.
I have gambled that (1) is correct,
that's why i gave this bugreport this title.
Portable code would never get bitten by this,
but in my test program it was rather annoying.
Thanks for your good works anyway.
Have a nice day :-)
Siward
--
Summary: "GNU system" is ambiguous
Product: glibc
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: manual
AssignedTo: roland at gnu dot org
ReportedBy: siward at wanadoo dot nl
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=6911
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.