remove now-unnecessary features.h inclusion from fnmatch.h
[musl] / src / stat / fstat.c
1 #include <sys/stat.h>
2 #include <errno.h>
3 #include "syscall.h"
4 #include "libc.h"
5
6 void __procfdname(char *, unsigned);
7
8 int fstat(int fd, struct stat *st)
9 {
10         int ret = __syscall(SYS_fstat, fd, st);
11         if (ret != -EBADF || fd < 0) return __syscall_ret(ret);
12
13         char buf[15+3*sizeof(int)];
14         __procfdname(buf, fd);
15         return syscall(SYS_stat, buf, st);
16 }
17
18 LFS64(fstat);