summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libc/sys/Makefile.inc2
-rw-r--r--lib/libc/sys/chflags.213
2 files changed, 14 insertions, 1 deletions
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index 238c7e4..5f78b60 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -90,7 +90,7 @@ MAN+= sched_get_priority_max.2 sched_setparam.2 \
MLINKS+=access.2 eaccess.2
MLINKS+=brk.2 sbrk.2
MLINKS+=chdir.2 fchdir.2
-MLINKS+=chflags.2 fchflags.2
+MLINKS+=chflags.2 fchflags.2 chflags.2 lchflags.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
diff --git a/lib/libc/sys/chflags.2 b/lib/libc/sys/chflags.2
index dae7efd..11cb734 100644
--- a/lib/libc/sys/chflags.2
+++ b/lib/libc/sys/chflags.2
@@ -37,6 +37,7 @@
.Os
.Sh NAME
.Nm chflags ,
+.Nm lchflags ,
.Nm fchflags
.Nd set file flags
.Sh LIBRARY
@@ -47,6 +48,8 @@
.Ft int
.Fn chflags "const char *path" "u_long flags"
.Ft int
+.Fn lchflags "const char *path" "int flags"
+.Ft int
.Fn fchflags "int fd" "u_long flags"
.Sh DESCRIPTION
The file whose name
@@ -57,6 +60,16 @@ or referenced by the descriptor
has its flags changed to
.Fa flags .
.Pp
+The
+.Fn lchflags
+system call is like
+.Fn chflags
+except in the case where the named file is a symbolic link,
+in which case
+.Fn lchflags
+will change the flags of the link itself,
+rather than the file it points to.
+.Pp
The flags specified are formed by
.Em or Ns 'ing
the following values
OpenPOWER on IntegriCloud