Syntax | #include <sys/types.h> int fchmod(int fildes, mode_t mode); | |||||||||||||||||||||||||||||||||||||||||||||||||
Description | Like
Other modes are constructed by a bit-wise OR combination of the file mode bits. The effective user ID of the process must match the owner of the file or the process must have the appropriate privilege to change the mode of a file. If neither the process nor a member of the supplementary group list is privileged, and if the effective group ID of the process does not match the group ID of the file, the mode bit 02000 (set group ID on execution) is cleared. If the mode bit 02000 (set group ID on execution) is set and the mode bit 00010 (execute or search by group) is not set, mandatory file/record locking will exist on a regular file. This may affect future calls to If the process is not a privileged process and the file is not a directory, the mode bit 01000 (save text segment after execution) is deleted. If a directory can be written to and the sticky bit is set, files in this directory can only be deleted or renamed if at least one of the following is true (see the file belongs to the user On successful completion, | |||||||||||||||||||||||||||||||||||||||||||||||||
Return val. | 0 -1 | if successful. if an error occurs. The file mode is not changed. | ||||||||||||||||||||||||||||||||||||||||||||||||
Errors |
| |||||||||||||||||||||||||||||||||||||||||||||||||
|
| fildes is not an open file descriptor. | ||||||||||||||||||||||||||||||||||||||||||||||||
|
| An attempt was made to access a BS2000 file, or the value of mode is invalid. | ||||||||||||||||||||||||||||||||||||||||||||||||
|
| An I/O error occurred while reading from or writing to the file system. | ||||||||||||||||||||||||||||||||||||||||||||||||
|
| A signal was caught during execution of the | ||||||||||||||||||||||||||||||||||||||||||||||||
|
| user ID does not match that of the file owner, and the process does not have the appropriate privileges. | ||||||||||||||||||||||||||||||||||||||||||||||||
|
| The file referred to by fildes resides on a read-only file system. | ||||||||||||||||||||||||||||||||||||||||||||||||
Notes |
| |||||||||||||||||||||||||||||||||||||||||||||||||
See also |
|