Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ chown(2) — GL2 W2.4

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

chmod(2)

CHOWN(2)  —  Silicon Graphics

NAME

chown − change owner and group of a file

SYNOPSIS

int chown (path, owner, group)
char ∗path;
int owner, group;

DESCRIPTION

Path points to a path name naming a file.  The owner ID and group ID of the named file are set to the numeric values contained in owner and group respectively. 

Only processes with effective user ID equal to the file owner or super-user may change the ownership of a file. 

If chown is invoked by other than the super-user, the set-user-ID and set-group-ID bits of the file mode, 04000 and 02000 respectively, will be cleared. 

Chown will fail and the owner and group of the named file will remain unchanged if one or more of the following are true:

A component of the path prefix is not a directory.  ­[ENOTDIR]

The named file does not exist.  ­[ENOENT]

Search permission is denied on a component of the path prefix.  ­[EACCES]

The effective user ID does not match the owner of the file and the effective user ID is not super-user.  ­[EPERM]

The named file resides on a read-only file system.  ­[EROFS]

Path points outside the process’s allocated address space.  ­[EFAULT]

RETURN VALUE

Upon successful completion, a value of 0 is returned.  Otherwise, a value of −1 is returned and errno is set to indicate the error. 

SEE ALSO

chmod(2). 

ASSEMBLER

moveq#16,D0
movlpath,A0
movlowner,D1
movlgroup,A1
trap#0

Carry bit set on failure and cleared on success. 

Version 2.4  —  May 08, 1986

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026