[Patch] Add Comment to io/fcntl.h

Patsy Franklin pfrankli@redhat.com
Mon Feb 25 14:53:00 GMT 2013


This patch adds a comment explaining why it's OK for
AT_REMOVEDIR and AT_EACCESS to have the same defined value.

It should be noted that AT_EACCESS is not yet reserved in
the Linux kernel and it should to avoid future confusion.

OK to checkin?


index 61834ce..9c149cb 100644
--- a/io/fcntl.h
+++ b/io/fcntl.h
@@ -129,6 +129,12 @@ typedef __pid_t pid_t;
  # define SEEK_END      2       /* Seek from end of file.  */
  #endif /* XPG */

+/* AT_REMOVEDIR AND AT_EACCESS have the same defined value below.
+ * 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.*/
  #ifdef __USE_ATFILE
  # define AT_FDCWD              -100    /* Special value used to indicate
                                            the *at functions should use the




More information about the Libc-alpha mailing list