

chown()                COHERENT System Call               chown()




Change ownership of a file

cchhoowwnn(_f_i_l_e, _u_i_d, _g_i_d)
cchhaarr *_f_i_l_e ;
sshhoorrtt _u_i_d, _g_i_d;

chown changes the owner of file to user id uid and group id gid.

To change  only the user  id without changing the  group id, stat
should be used to determine the value of gid to pass to chown.

chown is restricted  to the superuser, because granting the ordi-
nary user the ability to change the ownership of files might cir-
cumvent file  space quotas or  accounting based upon  file owner-
ship.

chown  returns -1  for errors,  such as  nonexistent file  or the
caller not being the superuser.

***** See Also *****

chmod(), COHERENT system calls, passwd, stat()


































COHERENT Lexicon                                           Page 1


