mirror of
git://git.musl-libc.org/musl
synced 2025-01-25 16:13:35 +00:00
provide an internal namespace-safe __fstat
this avoids the need for implementation-internal callers to depend on the nonstandard AT_EMPTY_PATH extension to use __fstatat and isolates knowledge of that extension to the implementation of __fstat.
This commit is contained in:
parent
fb10dc288d
commit
05a55868ff
@ -3,6 +3,7 @@
|
||||
|
||||
#include "../../../include/sys/stat.h"
|
||||
|
||||
hidden int __fstat(int, struct stat *);
|
||||
hidden int __fstatat(int, const char *restrict, struct stat *restrict, int);
|
||||
|
||||
#endif
|
||||
|
@ -4,12 +4,14 @@
|
||||
#include <fcntl.h>
|
||||
#include "syscall.h"
|
||||
|
||||
int fstat(int fd, struct stat *st)
|
||||
int __fstat(int fd, struct stat *st)
|
||||
{
|
||||
if (fd<0) return __syscall_ret(-EBADF);
|
||||
return fstatat(fd, "", st, AT_EMPTY_PATH);
|
||||
return __fstatat(fd, "", st, AT_EMPTY_PATH);
|
||||
}
|
||||
|
||||
weak_alias(__fstat, fstat);
|
||||
|
||||
#if !_REDIR_TIME64
|
||||
weak_alias(fstat, fstat64);
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user