.TH CHOWN 2 .UC .SH NAME chown \- change owner and group of a file .SH SYNOPSIS .B chown(name, owner, group) .br .B char *name; .SH DESCRIPTION The file whose name is given by the null-terminated string pointed to by .I name has its .I owner and .I group changed as specified. Only the super-user may execute this call, because if users were able to give files away, they could defeat the (nonexistent) file-space accounting procedures. .SH RETURN VALUE Upon successful completion, a value of 0 is returned. Otherwise, a value of \-1 is returned and .I errno is set to indicate the error. .SH ERRORS .I Chown will fail and the file will be unchanged if: .TP 20 [EINVAL] The argument path does not refer to a file. .TP 20 [ENOTDIR] A component of the path prefix is not a directory. .TP 20 [EINVAL] The path name contains a non-ASCII byte. .TP 20 [ENOENT] The named file does not exist. .TP 20 [EACCES] Search permission is denied on a component of the path prefix. .TP 20 [EPERM] The effective user ID does not match the owner of the file and the effective user ID is not the super-user. .TP 20 [EROFS] The named file resides on a read-only file system. .TP 20 [EFAULT] .I Name points outside the process's allocated address space. .TP 20 [ELOOP] Too many symbolic links were encountered in translating the path name. .SH "SEE ALSO" chown(1), passwd(5) .SH ASSEMBLER (chown = 16.) .br .B sys chown; name; owner; group