libc: Add O_PATH support for fgetxattr / fsetxattr

Support O_PATH file descriptors when handling fgetxattr and fsetxattr.
This avoids requiring file read access to pull extended attributes.

This is needed to support O_PATH file descriptors when calling
SELinux's fgetfilecon() call. In particular, this allows the querying
and setting of SELinux file context by using something like the following
code:

  int dirfd = open("/path/to/dir", O_DIRECTORY);
  int fd = openat(dirfd, "file", O_PATH | O_NOFOLLOW);
  char *context;
  fgetfilecon(fd, &context);

This change was motivated by a comment in
https://android-review.googlesource.com/#/c/152680/1/toys/posix/ls.c

Change-Id: Ic0cdf9f9dd0e35a63b44a4c4a08400020041eddf
diff --git a/libc/arch-x86/syscalls/fgetxattr.S b/libc/arch-x86/syscalls/___fgetxattr.S
similarity index 92%
rename from libc/arch-x86/syscalls/fgetxattr.S
rename to libc/arch-x86/syscalls/___fgetxattr.S
index 1eff931..2891511 100644
--- a/libc/arch-x86/syscalls/fgetxattr.S
+++ b/libc/arch-x86/syscalls/___fgetxattr.S
@@ -2,7 +2,7 @@
 
 #include <private/bionic_asm.h>
 
-ENTRY(fgetxattr)
+ENTRY(___fgetxattr)
     pushl   %ebx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
@@ -33,4 +33,5 @@
     popl    %ecx
     popl    %ebx
     ret
-END(fgetxattr)
+END(___fgetxattr)
+.hidden ___fgetxattr
diff --git a/libc/arch-x86/syscalls/fsetxattr.S b/libc/arch-x86/syscalls/___fsetxattr.S
similarity index 93%
rename from libc/arch-x86/syscalls/fsetxattr.S
rename to libc/arch-x86/syscalls/___fsetxattr.S
index 7af0ef0..287dafc 100644
--- a/libc/arch-x86/syscalls/fsetxattr.S
+++ b/libc/arch-x86/syscalls/___fsetxattr.S
@@ -2,7 +2,7 @@
 
 #include <private/bionic_asm.h>
 
-ENTRY(fsetxattr)
+ENTRY(___fsetxattr)
     pushl   %ebx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
@@ -38,4 +38,5 @@
     popl    %ecx
     popl    %ebx
     ret
-END(fsetxattr)
+END(___fsetxattr)
+.hidden ___fsetxattr