summaryrefslogtreecommitdiff
path: root/lib/libc/sys
diff options
context:
space:
mode:
authorMike Pritchard <mpp@FreeBSD.org>1999-07-30 10:09:30 +0000
committerMike Pritchard <mpp@FreeBSD.org>1999-07-30 10:09:30 +0000
commit571b5206caf9ae3af423b4752cbf5bcdd1821571 (patch)
tree4d57c4741d6e3c94c615e75349a432cf79105d98 /lib/libc/sys
parent33ccfbfdb76a2a7a7c3dd608a8d53d49d3442076 (diff)
Notes
Diffstat (limited to 'lib/libc/sys')
-rw-r--r--lib/libc/sys/Makefile.inc4
-rw-r--r--lib/libc/sys/chmod.242
2 files changed, 29 insertions, 17 deletions
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 8bd52cd5d3c4..0df2efbe8ef7 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -1,5 +1,5 @@
# @(#)Makefile.inc 8.3 (Berkeley) 10/24/94
-# $Id: Makefile.inc,v 1.57.2.1 1999/05/05 23:18:40 dt Exp $
+# $Id: Makefile.inc,v 1.57.2.2 1999/07/30 09:05:42 mpp Exp $
# sys sources
.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys ${.CURDIR}/../libc/sys
@@ -104,7 +104,7 @@ MLINKS+=brk.2 sbrk.2
MLINKS+=dup.2 dup2.2
MLINKS+=chdir.2 fchdir.2
MLINKS+=chflags.2 fchflags.2
-MLINKS+=chmod.2 fchmod.2
+MLINKS+=chmod.2 fchmod.2 chmod.2 lchmod.2
MLINKS+=chown.2 fchown.2 chown.2 lchown.2
MLINKS+=clock_gettime.2 clock_getres.2 clock_gettime.2 clock_settime.2
MLINKS+=getgid.2 getegid.2
diff --git a/lib/libc/sys/chmod.2 b/lib/libc/sys/chmod.2
index 9670629d1bd5..94f4ebd8bf3b 100644
--- a/lib/libc/sys/chmod.2
+++ b/lib/libc/sys/chmod.2
@@ -30,14 +30,15 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)chmod.2 8.1 (Berkeley) 6/4/93
-.\" $Id: chmod.2,v 1.11 1997/11/13 00:28:48 julian Exp $
+.\" $Id: chmod.2,v 1.12 1998/01/11 17:49:51 alex Exp $
.\"
.Dd June 4, 1993
.Dt CHMOD 2
.Os BSD 4
.Sh NAME
.Nm chmod ,
-.Nm fchmod
+.Nm fchmod ,
+.Nm lchmod
.Nd change mode of file
.Sh SYNOPSIS
.Fd #include <sys/stat.h>
@@ -45,27 +46,34 @@
.Fn chmod "const char *path" "mode_t mode"
.Ft int
.Fn fchmod "int fd" "mode_t mode"
+.Ft int
+.Fn lchmod "const char *path" "mode_t mode"
.Sh DESCRIPTION
-The function
-.Fn chmod
-sets the file permission bits
-of the file
-specified by the pathname
+The file permission bits of the file named specified by
.Fa path
-to
+or referenced by the file descriptor
+.Fa fd
+are changed to
.Fa mode .
-.Fn Fchmod
-sets the permission bits of the specified
-file descriptor
-.Fa fd .
-.Fn Chmod
-verifies that the process owner (user) either owns
+The
+.Fn chmod
+function verifies that the process owner (user) either owns
the file specified by
.Fa path
(or
.Fa fd ) ,
or
is the super-user.
+.The chmod
+function follows symbolic links to operate on the target of the link
+rather than the link itself.
+.Pp
+The
+.Fa lchmod
+function is similar to
+.Fn chmod
+but does not follow symbolic links.
+.Pp
A mode is created from
.Em or'd
permission bit masks
@@ -120,7 +128,7 @@ created within this directory are set
to be the same as the owner of that directory.
If this function is enabled, new directories will inherit
the bit from their parents. Execute bits are removed from
-the file, and it will not be given to root. This behaviour does not change the
+the file, and it will not be given to root. This behavior does not change the
requirements for the user to be allowed to write the file, but only the eventual
owner after it has been created. Group inheritance is not effected.
.Pp
@@ -208,3 +216,7 @@ The
function call
appeared in
.Bx 4.2 .
+The
+.Fn lchmod
+function call appeared in
+.Fx 3.0 .