summaryrefslogtreecommitdiff
path: root/src/stat/fstat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stat/fstat.c')
-rw-r--r--src/stat/fstat.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/stat/fstat.c b/src/stat/fstat.c
new file mode 100644
index 0000000..fd28b8a
--- /dev/null
+++ b/src/stat/fstat.c
@@ -0,0 +1,13 @@
+#define _BSD_SOURCE
+#include <sys/stat.h>
+#include <errno.h>
+#include <fcntl.h>
+#include "syscall.h"
+
+int __fstat(int fd, struct stat *st)
+{
+ if (fd<0) return __syscall_ret(-EBADF);
+ return __fstatat(fd, "", st, AT_EMPTY_PATH);
+}
+
+weak_alias(__fstat, fstat);