From ba23ba1ba9f283bff5347dcccd5321578b0f5a02 Mon Sep 17 00:00:00 2001 From: yar Date: Mon, 15 Nov 2004 13:37:56 +0000 Subject: Document the S_IS*(mode) macros used to test for file types. Bump the document date accordingly. --- lib/libc/sys/stat.2 | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'lib/libc') 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 -- cgit v1.1