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