mirror of
git://git.musl-libc.org/musl
synced 2025-03-06 20:48:29 +01:00
provide an internal namespace-safe __fstatat
this makes it so we can drop direct stat syscall use in interfaces that can't use the POSIX namespace.
This commit is contained in:
parent
7edbcbeb76
commit
c9ba0769a7
2 changed files with 11 additions and 1 deletions
8
src/include/sys/stat.h
Normal file
8
src/include/sys/stat.h
Normal file
|
@ -0,0 +1,8 @@
|
|||
#ifndef SYS_STAT_H
|
||||
#define SYS_STAT_H
|
||||
|
||||
#include "../../../include/sys/stat.h"
|
||||
|
||||
hidden int __fstatat(int, const char *restrict, struct stat *restrict, int);
|
||||
|
||||
#endif
|
|
@ -131,7 +131,7 @@ static int fstatat_kstat(int fd, const char *restrict path, struct stat *restric
|
|||
return 0;
|
||||
}
|
||||
|
||||
int fstatat(int fd, const char *restrict path, struct stat *restrict st, int flag)
|
||||
int __fstatat(int fd, const char *restrict path, struct stat *restrict st, int flag)
|
||||
{
|
||||
int ret;
|
||||
if (sizeof((struct kstat){0}.st_atime_sec) < sizeof(time_t)) {
|
||||
|
@ -142,6 +142,8 @@ int fstatat(int fd, const char *restrict path, struct stat *restrict st, int fla
|
|||
return __syscall_ret(ret);
|
||||
}
|
||||
|
||||
weak_alias(__fstatat, fstatat);
|
||||
|
||||
#if !_REDIR_TIME64
|
||||
weak_alias(fstatat, fstatat64);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue