Bug 19409 - some open() flags are undefined without _GNU_SOURCE
Summary: some open() flags are undefined without _GNU_SOURCE
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.22
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-12-28 03:32 UTC by Isabella
Modified: 2019-04-10 15:23 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Isabella 2015-12-28 03:32:51 UTC
I'm using arch linux with glibc 2.22-3 on linux 4.2.5, and I didn't
compile glibc myself, but I downloaded the source.  The line numbers are
from the latest git commit at the time of writing:

3cf74f8a4a0e0c7b7a9b4d40ba220832f33ea638
Fix getaddrinfo bug number in ChangeLog and NEWS files


O_DIRECT, O_NOATIME, O_PATH and O_TMPFILE are defined in lines 147-152 in
sysdeps/unix/sysv/linux/bits/fcntl-linux.h if __USE_GNU is defined.
Users need _GNU_SOURCE to enable them, but this isn't mentioned anywhere
in the docs.  Please add it.


---
xoxo iza
Comment 1 Dmitry V. Levin 2015-12-28 11:36:20 UTC
(In reply to Isabella from comment #0)
> Users need _GNU_SOURCE to enable them, but this isn't mentioned anywhere
> in the docs.  Please add it.

JFYI, open(2) manpage mentions this in "CONFORMING TO" section:

"The O_DIRECT, O_NOATIME, O_PATH, and O_TMPFILE flags are Linux-specific. One must define _GNU_SOURCE to obtain their definitions".
Comment 2 Isabella 2015-12-28 11:39:27 UTC
I'm sorry for the noise, I totally missed it