CHOWN(2)
NAME
chown − change owner and group of a file
SYNOPSIS
chown(name, owner, group)
char *name;
DESCRIPTION
The file whose name is given by the null-terminated string pointed to by name has its owner and group changed as specified. Only the superuser may execute this call, because if users were able to give files away, they could defeat the (nonexistent) file-space accounting procedures.
RETURN VALUE
Zero is returned if the owner is changed; −1 is returned on illegal owner changes.
DIAGNOSTICS
Chown will fail and the file will be unchanged if:
[EACCES] Search permission is denied on a component of the path prefix.
[EFAULT] Name points outside the process’s allocated address space.
[ENFILE] Insufficient system space to contain i-node.
[ENOENT] The named file, or an element within path name, does not exist.
[ENOTDIR] A component of the path prefix is not a directory.
[EPERM] The effective user ID does not match the owner of the file and the effective user ID is not the superuser.
[EROFS] The named file resides on a read-only file system.
SEE ALSO
ASSEMBLER
(chown = 16.)
sys chown; name; owner; group