[PATCH v2] Make some standard open() flags visible

Corinna Vinschen vinschen@redhat.com
Wed Oct 10 15:02:00 GMT 2018


On Oct 10 15:32, Sebastian Huber wrote:
> 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.

LGTM, but one last question.

> +/* 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

Doesn't that require to #define _POSIX_C_SOURCE 200809L in your
libc/posix/opendir.c patch?

> -#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
> -- 
> 2.16.4


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20181010/71e8efd7/attachment.sig>


More information about the Newlib mailing list