Open System Services System Calls Reference Manual (G06.28+, H06.05+)

System Functions (k - m) lchown(2)
If the owner or group parameter is specied as -1 cast to the type of uid_t or gid_t, respectively,
the corresponding ID of the le is unchanged. To change only one attribute, specify the other as
-1.
Upon successful completion, the lchown() function marks the st_ctime eld of the le for
update.
Access Control Lists (ACLs)
A user can allow or deny specic individuals and groups access to a le by using an ACL on the |
le. When using the lchown() function with ACLs, if the new owner and/or group of a le have |
optional ACL entries corresponding to user:uid:perm or group:gid:perm in the ACL for a le, |
those entries remain in the ACL but no longer have any effect because they are superseded by the |
user::perm or group::perm entries in the ACL. |
ACLs are not supported for symbolic links. |
For more information about ACLs, see the acl(5) reference page.
Use on Guardian Objects
You can use lchown() function on Guardian disk les (that is, disk les in the /G le system).
Attempts to change the ownership of other types of Guardian les fail and set errno to [EIN-
VAL].
For Guardian disk les, Guardian security is used, and any user can pass le ownership to any
other user. You must specify value other than -1 for the owner parameter (that is, an owner ID
must be specied). However, changing the owner ID also changes the group ID to the Guardian
group ID of the new owner (that is, bits <16:23> of the new access ID). You cannot use the
lchown() function to set the group ID for a Guardian le except as a result of changing the owner
ID.
The _POSIX_CHOWN_RESTRICTED feature is ignored for les in the Guardian le system
(that is, for les in /G).
Use From the Guardian Environment
The lchown() function is one of a set of functions that have these effects when the rst of them is
called from the Guardian environment:
Two Guardian le system le numbers (not necessarily the next two available) are allo-
cated for the root directory and the current working directory. These le numbers cannot
be closed by calling the Guardian FILE_CLOSE_ procedure.
The current working directory is assigned from the VOLUME attribute of the Guardian
environment =_DEFAULTS DEFINE.
The use of static memory by the process increases slightly.
These effects occur only when the rst of the set of functions is called. The effects are not cumu-
lative.
RETURN VALUES
Upon successful completion, the lchown() function returns the value 0 (zero). Otherwise, the
value -1 is returned, the owner and group of the le remain unchanged, and errno is set to indi-
cate the error.
527186-007 Hewlett-Packard Company 411