aboutsummaryrefslogtreecommitdiff
path: root/src/unistd/lchown.c
blob: 604d70ffcc27e55309029432ed6a808fa44f719b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <unistd.h>
#include <fcntl.h>
#include "syscall.h"

int lchown(const char *path, uid_t uid, gid_t gid)
{
#ifdef SYS_lchown
	return syscall(SYS_lchown, path, uid, gid);
#else
	return syscall(SYS_fchownat, AT_FDCWD, path, uid, gid, AT_SYMLINK_NOFOLLOW);
#endif
}


#ifdef TEST
int
main(void) {
	return 0;
}
#endif