2825f10b7f
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
27 lines
413 B
ArmAsm
27 lines
413 B
ArmAsm
/* Generated by gensyscalls.py. Do not edit. */
|
|
|
|
#include <private/bionic_asm.h>
|
|
|
|
ENTRY(___fsetxattr)
|
|
.set push
|
|
.set noreorder
|
|
li v0, __NR_fsetxattr
|
|
syscall
|
|
bnez a3, 1f
|
|
move a0, v0
|
|
j ra
|
|
nop
|
|
1:
|
|
move t0, ra
|
|
bal 2f
|
|
nop
|
|
2:
|
|
.cpsetup ra, t1, 2b
|
|
LA t9,__set_errno_internal
|
|
.cpreturn
|
|
j t9
|
|
move ra, t0
|
|
.set pop
|
|
END(___fsetxattr)
|
|
.hidden ___fsetxattr
|