[Patch] [v2] Add Comment to io/fcntl.h

Roland McGrath roland@hack.frob.com
Mon Feb 25 21:44:00 GMT 2013


> +/* The constants AT_REMOVEDIR and AT_EACCESS have the same value.  The
> +   AT_EACCESS value is only used by faccessat() and the AT_REMOVEDIR value is
> +   only used by unlinkat().  The two functions do completely different things
> +   and therefore the flags can be allowed to overlap.  For example, passing
> +   AT_REMOVEDIR to faccessat() would be undefined behavior and thus treating
> +   it equivalent to AT_EACCESS is valid undefined behavior.  */

Don't use "()" in text.  It's not part of English syntax.

Saying, "The FOO value is only used..." seems odd to me.  I would have
written something like, "AT_EACCESS is meaningful only to faccessat, while
AT_REMOVEDIR is meaningful only to unlinkat."


Thanks,
Roland



More information about the Libc-alpha mailing list