Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #include <sys/stat.h> |
Rich Felker | dd5f50d | 2014-05-29 21:01:32 -0400 | [diff] [blame] | 2 | #include <fcntl.h> |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 3 | #include "syscall.h" |
4 | |||||
5 | int chmod(const char *path, mode_t mode) | ||||
6 | { | ||||
Rich Felker | dd5f50d | 2014-05-29 21:01:32 -0400 | [diff] [blame] | 7 | #ifdef SYS_chmod |
Rich Felker | aa398f5 | 2011-03-20 00:16:43 -0400 | [diff] [blame] | 8 | return syscall(SYS_chmod, path, mode); |
Rich Felker | dd5f50d | 2014-05-29 21:01:32 -0400 | [diff] [blame] | 9 | #else |
10 | return syscall(SYS_fchmodat, AT_FDCWD, path, mode); | ||||
11 | #endif | ||||
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 12 | } |