[patch/ob] openat and friends for Cygwin

Eric Blake ebb9@byu.net
Thu Apr 24 09:40:00 GMT 2008

Hash: SHA1

According to Corinna Vinschen on 4/23/2008 5:13 AM:
| +#ifdef __CYGWIN__
| +/* Special descriptor value to denote the cwd in calls to openat(2) etc. */
| +#define AT_FDCWD -2

Is it worth trying to match Linux's definition of AT_FDCWD (-100, per
http://lkml.org/lkml/2008/2/27/421), if only for the benefit of (broken)
code that doesn't use the symbolic name?

| +
| +/* Flag values for faccessat2) et al. */
| +#define AT_EACCESS              1
| +#define AT_SYMLINK_NOFOLLOW     2
| +#define AT_SYMLINK_FOLLOW       4

Posix allows AT_SYMLINK_NOFOLLOW and AT_SYMLINK_FOLLOW to have the same
value, since the set of Posix *at() functions that require either flag are
mutually exclusive (ie. no single *at() function supports both flags).
But I'm okay with leaving them distinct, in case we come up with an
extension beyond what Posix requires where having them be distinct allows
them to both be useful to a single *at() function.

| +#ifdef __CYGWIN__
| +extern int futimesat _PARAMS ((int, const char *, const struct timeval *));

Shouldn't you also declare utimensat in sys/stat.h?  Posix 200x scrapped
futimesat in favor of utimensat, in part because nanosecond resolution is
too important to overlook, and in part, to add a flag parameter so you can
adjust timestamps of symlinks independently of what they point to on file
systems that support that.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org


More information about the Newlib mailing list