FCHMOD(3) Library Functions Manual FCHMOD(3)
NAME
fchmod — change
mode of a file
SYNOPSIS
#include <sys/stat.h> int fchmod(int fildes, mode_t mode);
DESCRIPTION
The fchmod() function has the same effect as chmod(3) except that the file whose permissions are to be changed is specified by the file descriptor fildes .
If the Shared Memory Objects option is supported, and fildes references a shared memory object, the fchmod() function need only affect the S_IRUSR, S_IWUSR, S_IRGRP, S_IWGRP, S_IROTH, and S_IWOTH file permission bits.
RETURN VALUE
Upon successful completion, fchmod() returns 0. Otherwise, it returns -1 and sets errno to indicate the error.
ERRORS
The fchmod() function will fail if:
- [EBADF]
- The fildes argument is not an open file descriptor.
- [EPERM]
- The effective user ID does not match the owner of the file and the process does not have appropriate privilege.
- [EROFS]
- The file referred to by fildes resides on a read-only file system.
The fchmod() function may fail if:
EXAMPLES
None.
APPLICATION USAGE
None.
FUTURE DIRECTIONS
None.
SEE ALSO
chmod(), chown(), creat(), fcntl(), fstatvfs(), mknod(), open(), read(), stat(), write(), <sys/stat.h>.
February 1997 posix.fail