diff options
Diffstat (limited to 'lib/libc/sys/stat.2')
-rw-r--r-- | lib/libc/sys/stat.2 | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/libc/sys/stat.2 b/lib/libc/sys/stat.2 index 887109a4744..dfab0110498 100644 --- a/lib/libc/sys/stat.2 +++ b/lib/libc/sys/stat.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: stat.2,v 1.19 2005/06/15 17:48:52 millert Exp $ +.\" $OpenBSD: stat.2,v 1.20 2006/10/05 05:05:57 ray Exp $ .\" .\" Copyright (c) 1980, 1991, 1993, 1994 .\" The Regents of the University of California. All rights reserved. @@ -175,6 +175,19 @@ has the following bits: #define S_IXUSR 0000100 /* execute/search permission, owner */ .Ed .Pp +The following macros test a file's type. +If the file is of that type, a non-zero value is returned; +otherwise, 0 is returned. +.Bd -literal -offset indent +S_ISBLK(st_mode m) /* block special */ +S_ISCHR(st_mode m) /* char special */ +S_ISDIR(st_mode m) /* directory */ +S_ISFIFO(st_mode m) /* fifo */ +S_ISLNK(st_mode m) /* symbolic link */ +S_ISREG(st_mode m) /* regular file */ +S_ISSOCK(st_mode m) /* socket */ +.Ed +.Pp For a list of access modes, see .Aq Pa sys/stat.h , .Xr access 2 , |