summaryrefslogtreecommitdiff
path: root/src/sys/stat/chmod.c
blob: f061e1a871dde476f9e5f3e77598b88171cfb3b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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)
*/