The fchmod() system call is used to change the permissions of an open file,
specified by the file descriptor fd. Unlike chmod(), fchmod() operates on
an open file descriptor, which eliminates certain race conditions that might
occur when using chmod().
fd:int[K] - File descriptor of the file whose permissions are to be changed.
mode:mode_t[K] - A bitmask of permission bits that will be used to set the new permissions.
* `S_ISUID (04000)`: Set-user-ID (sets process effective user ID on `execve(2)`)
* `S_ISGID (02000)`: Set-group-ID (sets process effective group ID on `execve(2)`; mandatory locking as described in `fcntl(2)`; takes a new file's group from parent directory as described in `chown(2)` and `mkdir(2)`)
* `S_ISVTX (01000)`: Sticky bit (restricted deletion flag as described in `unlink(2)`)
* `S_IRUSR (00400)`: Read by owner
* `S_IWUSR (00200)`: Write by owner
* `S_IXUSR (00100)`: Execute/search by owner ("search" applies for directories, allowing access to entries within)
* `S_IRGRP (00040)`: Read by group
* `S_IWGRP (00020)`: Write by group
* `S_IXGRP (00010)`: Execute/search by group
* `S_IROTH (00004)`: Read by others
* `S_IWOTH (00002)`: Write by others
* `S_IXOTH (00001)`: Execute/search by others