about summary refs log tree commit diff
path: root/src/stat/fstat.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2014-07-18 15:24:04 -0400
committerRich Felker <dalias@aerifal.cx>2014-07-18 15:24:04 -0400
commitdc9c40a609de6a79ec30013b0963a57393daa22e (patch)
tree710b5b41bf11a000fe76aa32aed82a5993cd141c /src/stat/fstat.c
parentd69ab5b3686acf75fdf5db6fad19c2c6a510bb4f (diff)
downloadmusl-dc9c40a609de6a79ec30013b0963a57393daa22e.tar.gz
musl-dc9c40a609de6a79ec30013b0963a57393daa22e.tar.xz
musl-dc9c40a609de6a79ec30013b0963a57393daa22e.zip
fix missing flags arg to fstatat syscall in fstat fallback path
this code path is used only on archs without the plain, non-at
syscalls, and only when the fstat syscall fails with EBADF on a valid
file descriptor. this in turn can happen only for O_PATH file
descriptors, and may not happen at all on the newer kernels needed for
supporting such archs.

with the flags argument omitted, spurious fstat failures may happen
when the argument register happens to have the AT_SYMLINK_NOFOLLOW bit
set.
Diffstat (limited to 'src/stat/fstat.c')
-rw-r--r--src/stat/fstat.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stat/fstat.c b/src/stat/fstat.c
index a9289867..ab4afc0f 100644
--- a/src/stat/fstat.c
+++ b/src/stat/fstat.c
@@ -17,7 +17,7 @@ int fstat(int fd, struct stat *st)
 #ifdef SYS_stat
 	return syscall(SYS_stat, buf, st);
 #else
-	return syscall(SYS_fstatat, AT_FDCWD, buf, st);
+	return syscall(SYS_fstatat, AT_FDCWD, buf, st, 0);
 #endif
 }