Commit c8ffd8bc authored by Miklos Szeredi's avatar Miklos Szeredi
Browse files

vfs: add faccessat2 syscall



POSIX defines faccessat() as having a fourth "flags" argument, while the
linux syscall doesn't have it.  Glibc tries to emulate AT_EACCESS and
AT_SYMLINK_NOFOLLOW, but AT_EACCESS emulation is broken.

Add a new faccessat(2) syscall with the added flags argument and implement
both flags.

The value of AT_EACCESS is defined in glibc headers to be the same as
AT_REMOVEDIR.  Use this value for the kernel interface as well, together
with the explanatory comment.

Also add AT_EMPTY_PATH support, which is not documented by POSIX, but can
be useful and is trivial to implement.

Signed-off-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
parent 55923e4d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -477,3 +477,4 @@
# 545 reserved for clone3
547	common	openat2				sys_openat2
548	common	pidfd_getfd			sys_pidfd_getfd
549	common	faccessat2			sys_faccessat2
+1 −0
Original line number Diff line number Diff line
@@ -451,3 +451,4 @@
435	common	clone3				sys_clone3
437	common	openat2				sys_openat2
438	common	pidfd_getfd			sys_pidfd_getfd
439	common	faccessat2			sys_faccessat2
+1 −1
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@
#define __ARM_NR_compat_set_tls		(__ARM_NR_COMPAT_BASE + 5)
#define __ARM_NR_COMPAT_END		(__ARM_NR_COMPAT_BASE + 0x800)

#define __NR_compat_syscalls		439
#define __NR_compat_syscalls		440
#endif

#define __ARCH_WANT_SYS_CLONE
+2 −0
Original line number Diff line number Diff line
@@ -883,6 +883,8 @@ __SYSCALL(__NR_clone3, sys_clone3)
__SYSCALL(__NR_openat2, sys_openat2)
#define __NR_pidfd_getfd 438
__SYSCALL(__NR_pidfd_getfd, sys_pidfd_getfd)
#define __NR_faccessat2 439
__SYSCALL(__NR_faccessat2, sys_faccessat2)

/*
 * Please add new compat syscalls above this comment and update
+1 −0
Original line number Diff line number Diff line
@@ -358,3 +358,4 @@
# 435 reserved for clone3
437	common	openat2				sys_openat2
438	common	pidfd_getfd			sys_pidfd_getfd
439	common	faccessat2			sys_faccessat2
Loading