1 /* vi: set sw=4 ts=4: */
5 * Copyright (C) 2000-2006 Erik Andersen <andersen@codepoet.org>
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
10 #include <sys/syscall.h>
12 #include <bits/wordsize.h>
14 #if (__WORDSIZE == 32 && defined(__NR_fchown32)) || __WORDSIZE == 64
17 # define __NR_fchown __NR_fchown32
20 _syscall3(int, fchown, int, fd, uid_t, owner, gid_t, group);
24 # define __NR___syscall_fchown __NR_fchown
25 static __inline__ _syscall3(int, __syscall_fchown, int, fd,
26 __kernel_uid_t, owner, __kernel_gid_t, group);
28 int fchown(int fd, uid_t owner, gid_t group)
30 if (((owner + 1) > (uid_t) ((__kernel_uid_t) - 1U))
31 || ((group + 1) > (gid_t) ((__kernel_gid_t) - 1U))) {
35 return (__syscall_fchown(fd, owner, group));