2 * fchmodat() for uClibc
4 * Copyright (C) 2009 Analog Devices Inc.
5 * Copyright (C) 2012 Mike Frysinger
7 * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
11 #include <sys/syscall.h>
16 * The kernel takes 3 args, but userland takes 4.
17 * We have to process all the flags ourselves.
19 int fchmodat(int fd, const char *file, mode_t mode, int flag)
21 /* We only support one flag atm ... */
22 if (flag & ~AT_SYMLINK_NOFOLLOW) {
27 /* ... but Linux doesn't support perms on symlinks. */
28 if (flag & AT_SYMLINK_NOFOLLOW) {
33 return INLINE_SYSCALL(fchmodat, 3, fd, file, mode);
35 libc_hidden_def(fchmodat)
37 /* should add emulation with fchmod() and /proc/self/fd/ ... */