内容简介
#includeint fchmodat(int dirfd, const char *path, mode_t mode ", int " flags )
描述
The%uA0fchmodat() system call operates in exactly the same way as%uA0chmod(2), except for the differences described in this manual page.
If the pathname given in%uA0path%uA0is relative, then it is interpreted relative to the directory referred to by the file descriptor%uA0dirfd%uA0(rather than relative to the current working directory of the calling process, as is done by%uA0chmod(2) for a relative pathname).
If the pathname given in%uA0path%uA0is relative and%uA0dirfd%uA0is the special value%uA0AT_FDCWD, thenpath%uA0is interpreted relative to the current working directory of the calling process (likechmod(2)).
If the pathname given in%uA0path%uA0is absolute, then%uA0dirfd%uA0is ignored.
flagsꃊn either be 0, or include the following flag:
标签 | 描述 |
---|---|
AT_SYMLINK_NOFOLLOW | If%uA0path%uA0is a symbolic link, do not dereference it: instead operate on the link itself. This flag is not currently implemented. |
返回值
On success,%uA0fchmodat() returns 0. On error, -1 is returned and%uA0errno%uA0is set to indicate the error.
错误
The same errors that occur for%uA0chmod(2) can also occur for%uA0fchmodat(). The following additional errors can occur for%uA0fchmodat():
标签 | 描述 |
---|---|
EBADF | dirfd%uA0is not a valid file descriptor. |
EINVAL | Invalid flag specified in%uA0flags. |
ENOTDIR | path%uA0is a relative path and%uA0dirfd%uA0is a file descriptor referring to a file other than a directory. |
ENOTSUP | flags%uA0specified%uA0AT_SYMLINK_NOFOLLOW, which is not supported. |
注意
See%uA0openat(2) for an explanation of the need for%uA0fchmodat().
遵循于
This system call is non-standard but is proposed for inclusion in a future revision of POSIX.1.
VERSIONS
fchmodat() was added to Linux in kernel 2.6.16.