int fchown(int dir_fd, char *path, int len, uint32_t user, uint32_t group, int flags);
This syscall sets the owner’s UID and GID for the passed arguments in the same way fstat fetches information for the passed arguments.
The syscall returns 0
on success or -1
on failure, with the
following errno:
EINVAL
The passed FD or the user and group were not valid.
EACCES
MAC did not allow this.
EBADF
The passed file is valid but it was not a physical file in a filesystem.