public inbox for newlib-cvs@sourceware.org help / color / mirror / Atom feed
From: Sebastian Huber <sh@sourceware.org> To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Make some standard open() flags visible Date: Thu, 11 Oct 2018 08:22:00 -0000 [thread overview] Message-ID: <20181011082138.72281.qmail@sourceware.org> (raw) https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=d3d838cc2630c416aff8d0b0d0bc1e44a5cf81dc commit d3d838cc2630c416aff8d0b0d0bc1e44a5cf81dc Author: Sebastian Huber <sebastian.huber@embedded-brains.de> Date: Mon Oct 8 14:27:38 2018 +0200 Make some standard open() flags visible Make the POSIX O_CLOEXEC, O_NOFOLLOW, O_DIRECTORY, O_EXEC, and O_SEARCH open() flags available also to non-Cygwin systems. Make the BSD/glibc O_DIRECT open() flag available also to non-Cygwin systems. Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de> Diff: --- newlib/libc/include/sys/_default_fcntl.h | 48 ++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/newlib/libc/include/sys/_default_fcntl.h b/newlib/libc/include/sys/_default_fcntl.h index 33b4622..22fa106 100644 --- a/newlib/libc/include/sys/_default_fcntl.h +++ b/newlib/libc/include/sys/_default_fcntl.h @@ -23,6 +23,19 @@ extern "C" { #define _FNONBLOCK 0x4000 /* non blocking I/O (POSIX style) */ #define _FNDELAY _FNONBLOCK /* non blocking I/O (4.2 style) */ #define _FNOCTTY 0x8000 /* don't assign a ctty on this open */ +#if defined (__CYGWIN__) +#define _FBINARY 0x10000 +#define _FTEXT 0x20000 +#endif +#define _FNOINHERIT 0x40000 +#define _FDIRECT 0x80000 +#define _FNOFOLLOW 0x100000 +#define _FDIRECTORY 0x200000 +#define _FEXECSRCH 0x400000 +#if defined (__CYGWIN__) +#define _FTMPFILE 0x800000 +#define _FNOATIME 0x1000000 +#endif #define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR) @@ -43,35 +56,28 @@ extern "C" { /* O_NDELAY _FNBIO set in include/fcntl.h */ #define O_NONBLOCK _FNONBLOCK #define O_NOCTTY _FNOCTTY -/* For machines which care - */ -#if defined (__CYGWIN__) -#define _FBINARY 0x10000 -#define _FTEXT 0x20000 -#define _FNOINHERIT 0x40000 -#define _FDIRECT 0x80000 -#define _FNOFOLLOW 0x100000 -#define _FDIRECTORY 0x200000 -#define _FEXECSRCH 0x400000 -#define _FTMPFILE 0x800000 -#define _FNOATIME 0x1000000 +/* POSIX-1.2008 specific flags */ +#if __POSIX_VISIBLE >= 200809 +#define O_CLOEXEC _FNOINHERIT +#define O_NOFOLLOW _FNOFOLLOW +#define O_DIRECTORY _FDIRECTORY +#define O_EXEC _FEXECSRCH +#define O_SEARCH _FEXECSRCH +#endif + +#if __BSD_VISIBLE +#define O_DIRECT _FDIRECT +#endif + +#if defined (__CYGWIN__) #define O_BINARY _FBINARY #define O_TEXT _FTEXT #define O_DSYNC _FSYNC #define O_RSYNC _FSYNC -#define O_EXEC _FEXECSRCH -#define O_SEARCH _FEXECSRCH - -/* POSIX-1.2008 specific flags */ -#if __POSIX_VISIBLE >= 200809 -#define O_CLOEXEC _FNOINHERIT -#define O_NOFOLLOW _FNOFOLLOW -#define O_DIRECTORY _FDIRECTORY -#endif /* Linux-specific flags */ #if __GNU_VISIBLE -#define O_DIRECT _FDIRECT #define O_TMPFILE _FTMPFILE #define O_NOATIME _FNOATIME #endif
reply other threads:[~2018-10-11 8:22 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20181011082138.72281.qmail@sourceware.org \ --to=sh@sourceware.org \ --cc=newlib-cvs@sourceware.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).