bionic/libc/arch-mips64/syscalls
Nick Kralevich 35778253a5 Fix "faccessat ignores flags"
The kernel system call faccessat() does not have any flags arguments,
so passing flags to the kernel is currently ignored.

Fix the kernel system call so that no flags argument is passed in.

Ensure that we don't support AT_SYMLINK_NOFOLLOW. This non-POSIX
(http://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html)
flag is a glibc extension, and has non-intuitive, error prone behavior.

For example, consider the following code:

  symlink("foo.is.dangling", "foo");
  if (faccessat(AT_FDCWD, "foo", R_OK, AT_SYMLINK_NOFOLLOW) == 0) {
    int fd = openat(AT_FDCWD, "foo", O_RDONLY | O_NOFOLLOW);
  }

The faccessat() call in glibc will return true, but an attempt to
open the dangling symlink will end up failing. GLIBC documents this
as returning the access mode of the symlink itself, which will
always return true for any symlink on Linux.

Some further discussions of this are at:

  * http://lists.landley.net/pipermail/toybox-landley.net/2014-September/003617.html
  * http://permalink.gmane.org/gmane.linux.lib.musl.general/6952

AT_SYMLINK_NOFOLLOW seems broken by design. I suspect this is why this
function was never added to POSIX. (note that "access" is pretty much
broken by design too, since it introduces a race condition between
check and action). We shouldn't support this until it's clearly
documented by POSIX or we can have it produce intuitive results.

Don't support AT_EACCESS for now. Implementing it is complicated, and
pretty much useless on Android, since we don't have setuid binaries.
See http://git.musl-libc.org/cgit/musl/commit/?id=0a05eace163cee9b08571d2ff9d90f5e82d9c228
for how an implementation might look.

Bug: 18867827
Change-Id: I25b86c5020f3152ffa3ac3047f6c4152908d0e04
2015-02-24 13:40:43 -08:00
..
___faccessat.S Fix "faccessat ignores flags" 2015-02-24 13:40:43 -08:00
___fchmod.S Ensure raw fchmod/fchmodat syscalls are hidden. 2015-02-03 12:10:30 -08:00
___fchmodat.S Ensure raw fchmod/fchmodat syscalls are hidden. 2015-02-03 12:10:30 -08:00
__accept4.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__brk.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__clock_nanosleep.S Add clock_settime and clock_nanosleep. 2014-10-13 17:04:10 -07:00
__connect.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__epoll_pwait.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__exit.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__fadvise64.S Add posix_fadvise(3). 2014-09-11 08:45:46 -07:00
__getcpu.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__getcwd.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__getdents64.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__getpid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__getpriority.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__ioctl.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__openat.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__ppoll.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__pselect6.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__ptrace.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__reboot.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__rt_sigaction.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__rt_sigpending.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__rt_sigprocmask.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__rt_sigqueueinfo.S support _POSIX_REALTIME_SIGNALS 2014-12-08 21:52:43 -08:00
__rt_sigsuspend.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__rt_sigtimedwait.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__sched_getaffinity.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__set_tid_address.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__set_tls.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__signalfd4.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__socket.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__timer_create.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__timer_delete.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__timer_getoverrun.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__timer_gettime.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__timer_settime.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
__waitid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
_exit.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
acct.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
bind.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
capget.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
capset.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
chdir.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
chroot.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
clock_getres.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
clock_gettime.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
clock_settime.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
close.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
delete_module.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
dup3.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
dup.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
epoll_create1.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
epoll_ctl.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
eventfd.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
execve.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
fallocate.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
fchdir.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
fchown.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
fchownat.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
fcntl.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
fdatasync.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
fgetxattr.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
flistxattr.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
flock.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
fremovexattr.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
fsetxattr.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
fstatfs64.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
fsync.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
ftruncate.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getegid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
geteuid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getgid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getgroups.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getitimer.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getpeername.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getpgid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getppid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getresgid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getresuid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getrlimit.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getrusage.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getsid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getsockname.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getsockopt.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
gettimeofday.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getuid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
getxattr.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
init_module.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
inotify_add_watch.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
inotify_init1.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
inotify_rm_watch.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
kill.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
klogctl.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
lgetxattr.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
linkat.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
listen.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
listxattr.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
llistxattr.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
lremovexattr.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
lseek.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
lsetxattr.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
madvise.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
mincore.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
mkdirat.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
mknodat.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
mlock.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
mlockall.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
mmap.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
mount.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
mprotect.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
mremap.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
msync.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
munlock.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
munlockall.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
munmap.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
nanosleep.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
personality.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
pipe2.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
prctl.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
pread64.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
prlimit64.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
pwrite64.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
read.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
readahead.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
readlinkat.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
readv.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
recvfrom.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
recvmmsg.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
recvmsg.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
removexattr.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
renameat.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sched_get_priority_max.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sched_get_priority_min.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sched_getparam.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sched_getscheduler.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sched_rr_get_interval.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sched_setaffinity.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sched_setparam.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sched_setscheduler.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sched_yield.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sendfile.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sendmmsg.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sendmsg.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sendto.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setfsgid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setfsuid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setgid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setgroups.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sethostname.S Add sethostname(2). 2014-11-07 16:48:27 -08:00
setitimer.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setns.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setpgid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setpriority.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setregid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setresgid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setresuid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setreuid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setrlimit.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setsid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setsockopt.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
settimeofday.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setuid.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
setxattr.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
shutdown.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sigaltstack.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
socketpair.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
splice.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
statfs64.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
swapoff.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
swapon.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
symlinkat.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sync.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
sysinfo.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
tee.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
tgkill.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
timerfd_create.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
timerfd_gettime.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
timerfd_settime.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
times.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
truncate.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
umask.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
umount2.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
uname.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
unlinkat.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
unshare.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
utimensat.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
vmsplice.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
wait4.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
write.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00
writev.S Ensure __set_errno is still visible on LP32. 2014-09-08 16:46:50 -07:00