From 4abab5ad6c8465a7528ccdd5f49367da05f78bbd Mon Sep 17 00:00:00 2001 From: Vladimir Azarov Date: Tue, 1 Oct 2024 15:47:05 +0200 Subject: Initial version --- src/unistd/lchown.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 src/unistd/lchown.c (limited to 'src/unistd/lchown.c') diff --git a/src/unistd/lchown.c b/src/unistd/lchown.c new file mode 100644 index 0000000..ccd5ee0 --- /dev/null +++ b/src/unistd/lchown.c @@ -0,0 +1,12 @@ +#include +#include +#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 +} -- cgit v1.2.3