01.01.2013 Views

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

AT&T UNIX™PC Unix System V Users Manual - tenox

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHOWN(2) CHOWN(2)<br />

NAME<br />

chown - change owner and group of a file<br />

SYNOPSIS<br />

int chown (path, owner, group)<br />

char *path;<br />

int owner, group;<br />

DESCRIPTION<br />

Path points to a path name naming a file. The owner ID and<br />

group ID of the named file are set to the numeric values contained<br />

in owner and group respectively.<br />

Only processes with effective user ID equal to the file owner or<br />

super-user may change the ownership of a file.<br />

If chown is invoked by other than the super-user, the set-user-ID<br />

and set-group-ID bits of the file mode, 04000 and 02000 respectively,<br />

will be cleared.<br />

Chown will fail and the owner and group of the named file will<br />

remain unchanged if one or more of the following are true:<br />

A component of the path prefix is not a directory.<br />

IENOTDffil<br />

The named file does not exist. IENOENTI<br />

Search permission is denied on a component of the path<br />

prefix. IEACCESI<br />

The effective user ID does not match the owner of the file<br />

and the effective user ID is not super-user. IEPERMI<br />

The named file resides on a read-only file system. IEROFSI<br />

Path points outside the process's allocated address space.<br />

IEFAULTI<br />

RETURN VALUE<br />

Upon successful completion, a value of 0 is returned. Otherwise, a<br />

value of -1 is returned and errno is set to indicate the error.<br />

SEE ALSO<br />

chmod(2).<br />

- 1-

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!