diff options
| author | Jakob Kaivo <jkk@ung.org> | 2019-02-09 13:14:01 -0500 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2019-02-09 13:14:01 -0500 |
| commit | 253a32e2f9ff1cbb8edbe7c79834a678daebeb93 (patch) | |
| tree | 599cf5baf01c6dae33a2f89989b08b7d553f7fd0 /src/sys/stat/chmod.c | |
| parent | 88d0b5e7ffbf0554b236dc46225846061b5f4817 (diff) | |
merge POSIX.1-1988/1990
Diffstat (limited to 'src/sys/stat/chmod.c')
| -rw-r--r-- | src/sys/stat/chmod.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/sys/stat/chmod.c b/src/sys/stat/chmod.c new file mode 100644 index 00000000..f061e1a8 --- /dev/null +++ b/src/sys/stat/chmod.c @@ -0,0 +1,17 @@ +#include "sys/types.h" +#include <sys/stat.h> +#include "nonstd/syscall.h" + +int chmod(const char *path, mode_t mode) +{ + SCNO(scno, "chmod", -1); + int r = __libc.syscall(scno, path, mode); + if (r < 0) { + errno = -r; + return -1; + } + return 0; +} +/* +POSIX(1) +*/ |
