Table of Contents
The
owner ID and group ID of the file named by or referenced by is changed
as specified by the arguments and The owner of a file may change the
to a group of which he or she is a member, but the change capability
is restricted to the super-user. clears the set-user-id and set-group-id bits
on the file to prevent accidental or mischievous creation of set-user-id
and set-group-id programs. is particularly useful when used in conjunction
with the file locking primitives (see One of the owner or group id’s may
be left unchanged by specifying it as -1.
Zero is returned if
the operation was successful; -1 is returned if an error occurs, with a
more specific error code being placed in the global variable
will
fail and the file will be unchanged if: A component of the path prefix
is not a directory. A component of a pathname exceeded characters, or
an entire path name exceeded characters. The named file does not exist.
Search permission is denied for a component of the path prefix. Too many
symbolic links were encountered in translating the pathname. The effective
user ID is not the super-user. The named file resides on a read-only file
system. points outside the process’s allocated address space. An I/O error
occurred while reading from or writing to the file system. will fail
if: does not refer to a valid descriptor. refers to a socket, not a
file. The effective user ID is not the super-user. The named file resides
on a read-only file system. An I/O error occurred while reading from or
writing to the file system.
The function is expected
to conform to
The function call appeared in The and functions
were changed to follow symbolic links in
Table of Contents