diff --git a/libc/include/sys/stat.h b/libc/include/sys/stat.h index f6e76e04..21aaebc3 100644 --- a/libc/include/sys/stat.h +++ b/libc/include/sys/stat.h @@ -29,6 +29,9 @@ extern "C" /* Retrieve information about a file. */ int fstat(int fd, struct stat* st); + /* Retrieve information about a file. */ + int fstatat(int dirfd, const char* path, struct stat* st, int flags); + #ifdef __cplusplus } #endif diff --git a/libc/src/sys/stat.cpp b/libc/src/sys/stat.cpp index 89cb3a45..a33cacf9 100644 --- a/libc/src/sys/stat.cpp +++ b/libc/src/sys/stat.cpp @@ -29,4 +29,10 @@ extern "C" long rc = syscall(SYS_fstatat, fd, "", st, AT_EMPTY_PATH); __errno_return(rc, int); } + + int fstatat(int dirfd, const char* path, struct stat* st, int flags) + { + long rc = syscall(SYS_fstatat, dirfd, path, st, flags); + __errno_return(rc, int); + } }