use namespace-safe __lseek for __stdio_seek instead of direct syscall
[musl] / src / stat / stat.c
index c6de716..0bec9d6 100644 (file)
@@ -1,10 +1,14 @@
 #include <sys/stat.h>
+#include <fcntl.h>
 #include "syscall.h"
-#include "libc.h"
 
 int stat(const char *restrict path, struct stat *restrict buf)
 {
+#ifdef SYS_stat
        return syscall(SYS_stat, path, buf);
+#else
+       return syscall(SYS_fstatat, AT_FDCWD, path, buf, 0);
+#endif
 }
 
-LFS64(stat);
+weak_alias(stat, stat64);