Add C library interface for new system call lchmod, lchown and lutimes.

This commit is contained in:
enami 1997-10-06 01:12:04 +00:00
parent ac03dfe307
commit 435d770085
2 changed files with 51 additions and 3 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: chmod.2,v 1.11 1997/07/14 23:19:51 kleink Exp $
.\" $NetBSD: chmod.2,v 1.12 1997/10/06 01:12:04 enami Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -38,6 +38,7 @@
.Os BSD 4
.Sh NAME
.Nm chmod ,
.Nm lchmod ,
.Nm fchmod
.Nd change mode of file
.Sh SYNOPSIS
@ -46,6 +47,8 @@
.Ft int
.Fn chmod "const char *path" "mode_t mode"
.Ft int
.Fn lchmod "const char *path" "mode_t mode"
.Ft int
.Fn fchmod "int fd" "mode_t mode"
.Sh DESCRIPTION
The function
@ -60,6 +63,16 @@ to
sets the permission bits of the specified
file descriptor
.Fa fd .
.Fn Lchmod
is like
.Fn chmod
except in the case where the named file is a symbolic link,
in which case
.Fn lchmod
sets the permission bits of the link,
while
.Fn chmod
sets the bits of the file the link references.
.Fn Chmod
verifies that the process owner (user) either owns
the file specified by
@ -165,6 +178,12 @@ and
does not refer to a directory.
.El
.Pp
.Fn Lchmod
is like
.Fn chmod
except that it doesn't return
.Er ELOOP .
.Pp
.Fn Fchmod
will fail if:
.Bl -tag -width Er
@ -203,3 +222,7 @@ The
function call
appeared in
.Bx 4.2 .
The
.Fn lchmod
function call appeared in
.Nx 1.3 .

View File

@ -1,4 +1,4 @@
.\" $NetBSD: chown.2,v 1.12 1997/07/14 23:19:52 kleink Exp $
.\" $NetBSD: chown.2,v 1.13 1997/10/06 01:12:05 enami Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@ -38,6 +38,7 @@
.Os BSD 4
.Sh NAME
.Nm chown ,
.Nm lchown ,
.Nm fchown
.Nd change owner and group of a file
.Sh SYNOPSIS
@ -46,6 +47,8 @@
.Ft int
.Fn chown "const char *path" "uid_t owner" "gid_t group"
.Ft int
.Fn lchown "const char *path" "uid_t owner" "gid_t group"
.Ft int
.Fn fchown "int fd" "uid_t owner" "gid_t group"
.Sh DESCRIPTION
The owner ID and group ID of the file
@ -65,7 +68,8 @@ but the change
.Fa owner
capability is restricted to the super-user.
.Pp
.Fn Chown
.Fn Chown ,
.Fn lchown
and
.Fn fchown
clear the set-user-id and set-group-id bits
@ -73,6 +77,17 @@ on the file
to prevent accidental or mischievous creation of
set-user-id and set-group-id programs.
.Pp
.Fn Lchown
is like
.Fn chown
except in the case where the named file is a symbolic link,
in which case
.Fn lchown
changes the owner and group of the link,
while
.Fn chown
changes the owner and group of the file the link references.
.Pp
.Fn Fchown
is particularly useful when used in conjunction
with the file locking primitives (see
@ -114,6 +129,12 @@ points outside the process's allocated address space.
An I/O error occurred while reading from or writing to the file system.
.El
.Pp
.Fn Lchown
is like
.Fn chown
execpt that it doesn't return
.Er ELOOP .
.Pp
.Fn Fchown
will fail if:
.Bl -tag -width Er
@ -152,3 +173,7 @@ and
.Fn fchown
functions were changed to follow symbolic links in
.Bx 4.4 .
The
.Fn lchown
function call appeared in
.Nx 1.3 .