summaryrefslogtreecommitdiff
path: root/src/stat
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2022-05-04 10:51:00 -0400
committerRich Felker <dalias@aerifal.cx>2022-05-04 10:51:00 -0400
commit05a55868ff0f42cfc8701c7977322aa4c8e1aca3 (patch)
tree6aad7a402fac77f4e8c47ba83a851192b1a0ad58 /src/stat
parentfb10dc288d74442ea85c26b0ac3810f05377cba9 (diff)
downloadmusl-05a55868ff0f42cfc8701c7977322aa4c8e1aca3.tar.gz
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.
Diffstat (limited to 'src/stat')
-rw-r--r--src/stat/fstat.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/stat/fstat.c b/src/stat/fstat.c
index 9bbb46de..27db0ccb 100644
--- a/src/stat/fstat.c
+++ b/src/stat/fstat.c
@@ -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