libc: Add wrapper for the fstatat() system call

This commit is contained in:
apio 2023-05-01 20:00:43 +02:00
parent 458e0a87cc
commit 2572d5b238
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 9 additions and 0 deletions

View File

@ -29,6 +29,9 @@ extern "C"
/* Retrieve information about a file. */ /* Retrieve information about a file. */
int fstat(int fd, struct stat* st); 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 #ifdef __cplusplus
} }
#endif #endif

View File

@ -29,4 +29,10 @@ extern "C"
long rc = syscall(SYS_fstatat, fd, "", st, AT_EMPTY_PATH); long rc = syscall(SYS_fstatat, fd, "", st, AT_EMPTY_PATH);
__errno_return(rc, int); __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);
}
} }