summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2004-11-15 13:37:56 +0000
committeryar <yar@FreeBSD.org>2004-11-15 13:37:56 +0000
commitba23ba1ba9f283bff5347dcccd5321578b0f5a02 (patch)
tree0d42e2a27db379ccbc7017b00bda61c26ab1673e /lib
parentb5f85e2fdbe57c793be996cfebb9c55280048b24 (diff)
downloadFreeBSD-src-ba23ba1ba9f283bff5347dcccd5321578b0f5a02.zip
FreeBSD-src-ba23ba1ba9f283bff5347dcccd5321578b0f5a02.tar.gz
Document the S_IS*(mode) macros used to test for file types.
Bump the document date accordingly.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/sys/stat.228
1 files changed, 27 insertions, 1 deletions
diff --git a/lib/libc/sys/stat.2 b/lib/libc/sys/stat.2
index 842492a..3be06a6 100644
--- a/lib/libc/sys/stat.2
+++ b/lib/libc/sys/stat.2
@@ -32,7 +32,7 @@
.\" @(#)stat.2 8.4 (Berkeley) 5/1/95
.\" $FreeBSD$
.\"
-.Dd February 15, 2002
+.Dd November 15, 2004
.Dt STAT 2
.Os
.Sh NAME
@@ -185,6 +185,32 @@ For a list of access modes, see
.Xr access 2
and
.Xr chmod 2 .
+The following macros are available to test whether a
+.Va st_mode
+value passed in the
+.Ar m
+argument corresponds to a file of the specified type:
+.Bl -tag -width ".Fn S_ISFIFO m"
+.It Fn S_ISBLK m
+Test for a block special file.
+.It Fn S_ISCHR m
+Test for a character special file.
+.It Fn S_ISDIR m
+Test for a directory.
+.It Fn S_ISFIFO m
+Test for a pipe or FIFO special file.
+.It Fn S_ISLNK m
+Test for a symbolic link.
+.It Fn S_ISREG m
+Test for a regular file.
+.It Fn S_ISSOCK m
+Test for a socket.
+.It Fn S_ISWHT m
+Test for a whiteout.
+.El
+.Pp
+The macros evaluate to a non-zero value if the test is true
+or to the value 0 if the test is false.
.Sh RETURN VALUES
.Rv -std
.Sh COMPATIBILITY
OpenPOWER on IntegriCloud