T_REMOVEDIR and AT_EACCESS have the same value.
authorPatsy Franklin <pfrankli@redhat.com>
Wed, 6 Mar 2013 17:54:10 +0000 (12:54 -0500)
committerPatsy Franklin <pfrankli@redhat.com>
Wed, 6 Mar 2013 18:39:16 +0000 (13:39 -0500)
Add comments to fcntl.h explaining why AT_REMOVEDIR
and AT_EACCESS can have the same value.

ChangeLog
io/fcntl.h

index a175d61..c82ed84 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-03-06  Patsy Franklin  <pfrankli@redhat.com>
+
+       * io/fcntl.h: Added a comment about AT_EACCESS and AT_REMOVEDIR.
+
 2013-03-06  Andreas Jaeger  <aj@suse.de>
 
        * sysdeps/unix/sysv/linux/bits/mman-linux.h (MAP_ANONYMOUS): Allow
index 61834ce..14ccae0 100644 (file)
@@ -129,6 +129,12 @@ typedef __pid_t pid_t;
 # define SEEK_END      2       /* Seek from end of file.  */
 #endif /* XPG */
 
+/* The constants AT_REMOVEDIR and AT_EACCESS have the same value.  AT_EASSESS
+   is meaningful only to faccessat, while AT_REMOVEDIR is meaningful only to
+   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