Go to the previous, next section.

chmod and fchmod

SYNOPSIS

int chmod(const char *path, mode_t mode);

int fchmod(int fd, mode_t mode);

PARAMETERS

path: [in] points to the path of the file to modify.

fd: [in] the file descriptor to modify.

mode: [in] the new mode.

DESCRIPTION

chmod changes the mode of the file specified by path to mode. fchmod changes the mode of the file descriptor specified by fd to mode.The possible values of mode are obtained by or'ing the following constants:

RETURN VALUE

On success zero is returned. On error, -1 is returned and errno is set to one of the following values:

for chmod:

for fchmod:

Go to the previous, next section.