chown.2 (2010 09)
c
chown(2) chown(2)
ERRORS
If chown() or lchown() fails, errno is set to one of the following values:
[EACCES] Search permission is denied on a component of the path prefix.
[EFAULT] path points outside the allocated address space of the process. The reliable detec-
tion of this error is implementation dependent.
[ELOOP] Too many symbolic links were encountered in translating path .
[ENAMETOOLONG]
A component of path exceeds
NAME_MAX bytes while
_POSIX_NO_TRUNC is in
effect, or path exceeds
PATH_MAX bytes.
[ENOENT] The file named by path does not exist.
[ENOTDIR] A component of the path prefix is not a directory.
[EINVAL] Either owner or group is greater than or equal to
UID_MAX, or is an illegal negative
value.
[EPERM] The effective user ID is not a user with
OWNER privilege and one or more of the fol-
lowing conditions exist:
• The effective user ID does not match the owner of the file.
• When changing the owner of the file, the owner of the file is not a member of a
privilege group allowing the
CHOWN privilege.
• When changing the group of the file, the owner of the file is not a member of a
privilege group allowing the
CHOWN privilege and the group number is not in the
current process’s access list.
[EROFS] The named file resides on a read-only file system.
If
fchown() fails, errno is set to one of the following values:
[EBADF] fildes is not a valid file descriptor.
[EINVAL] Either owner or group is greater than or equal to
UID_MAX, or is an illegal negative
value.
[EPERM] The effective user ID is not a user having
OWNER privilege and one or more of the
following conditions exist:
• The effective user ID does not match the owner of the file.
• When changing the owner of the file, the owner of the file is not a member of a
privilege group allowing the
CHOWN privilege.
• When changing the group of the file, the owner of the file is not a member of a
privilege group allowing the
CHOWN privilege and the group number is not in the
current process’s access list.
[EROFS] The named file resides on a read-only file system.
AUTHOR
chown() was developed by AT&T.
fchown() was developed by the University of California, Berkeley.
SEE ALSO
chown(1), setprivgrp(1M), chmod(2), setacl(2), acl(5), aclv(5), limits(5), privileges(5).
STANDARDS CONFORMANCE
chown(): AES, SVID2, SVID3, XPG2, XPG3, XPG4, FIPS 151-2, POSIX.1
fchown(): AES, SVID3
2 Hewlett-Packard Company − 2 − HP-UX 11i Version 3: September 2010