refactor all stat functions in terms of fstatat
[musl] / src / stat / stat.c
index 67640cc..b4e6279 100644 (file)
@@ -1,10 +1,10 @@
 #include <sys/stat.h>
+#include <fcntl.h>
 #include "syscall.h"
-#include "libc.h"
 
-int stat(const char *path, struct stat *buf)
+int stat(const char *restrict path, struct stat *restrict buf)
 {
-       return syscall2(__NR_stat64, (long)path, (long)buf);
+       return fstatat(AT_FDCWD, path, buf, 0);
 }
 
-LFS64(stat);
+weak_alias(stat, stat64);