blob: d4f53c564e14701ea360a7159037c39838266d9f [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#include <sys/stat.h>
Rich Felkerdd5f50d2014-05-29 21:01:32 -04002#include <fcntl.h>
Rich Felker0b44a032011-02-12 00:22:29 -05003#include "syscall.h"
4
5int chmod(const char *path, mode_t mode)
6{
Rich Felkerdd5f50d2014-05-29 21:01:32 -04007#ifdef SYS_chmod
Rich Felkeraa398f52011-03-20 00:16:43 -04008 return syscall(SYS_chmod, path, mode);
Rich Felkerdd5f50d2014-05-29 21:01:32 -04009#else
10 return syscall(SYS_fchmodat, AT_FDCWD, path, mode);
11#endif
Rich Felker0b44a032011-02-12 00:22:29 -050012}