CHOWN(2) DOMAIN/IX Reference Manual (SYS5) CHOWN(2)
NAME
chown - change owner and group of a file
USAGE
int chown (path, owner, group)
char *path;
int owner, group;
DESCRIPTION
Path names a file. Chown sets the owner ID and group ID of
that file to the numeric values contained in owner and
group, respectively.
Only processes with the effective user ID of the file owner
or those with the ID of the super-user may change the owner-
ship of a file.
If chown is invoked by anyone other than the super-user, the
set-user-ID and set-group-ID bits of the file mode, 04000
and 02000 respectively, are cleared.
ERRORS
Chown will fail and the owner and group of the named file
remain unchanged if one or more of the following is true:
[ENOTDIR] A component of the path prefix is not a
directory.
[ENOENT] The file named does not exist.
[EACCES] Search permission is denied on a component of
the path prefix.
[EPERM] The effective user ID does not match the
owner of the file and the effective user ID
is not super-user.
[EROFS] The file named resides on a read-only file
system.
[EFAULT] Path points outside the allocated address
space of the process.
NOTES
Files that are protected for write-only or execute-only by
chown(1) or chown(2) are also made available for read
access. This is required by the Apollo I/O system.
RETURN VALUE
Chown returns zero upon successful execution; otherwise, it
returns a value of -1 and sets errno to indicate the error.
Printed 5/14/85 CHOWN-1
CHOWN(2) DOMAIN/IX Reference Manual (SYS5) CHOWN(2)
RELATED INFORMATION
chown(1) chmod(2)
CHOWN-2 Printed 5/14/85