X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstat%2Fstat.c;h=b4433a0a7cd13893b6889e89cfc3eac7e98178d1;hb=2fab90a71acd3698954c08b9062db67188443dd7;hp=9847552afddf29e2f590f8fe43d5a5bb30ac7f43;hpb=cfe373146d232d7c89a60920f77b9451bcfee96b;p=musl diff --git a/src/stat/stat.c b/src/stat/stat.c index 9847552a..b4433a0a 100644 --- a/src/stat/stat.c +++ b/src/stat/stat.c @@ -1,10 +1,15 @@ #include +#include #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_stat, (long)path, (long)buf); +#ifdef SYS_stat + return syscall(SYS_stat, path, buf); +#else + return syscall(SYS_fstatat, AT_FDCWD, path, buf, 0); +#endif } LFS64(stat);