summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/sys/stat.263
1 files changed, 32 insertions, 31 deletions
diff --git a/lib/libc/sys/stat.2 b/lib/libc/sys/stat.2
index 47ba2850cd4..2643b3a700f 100644
--- a/lib/libc/sys/stat.2
+++ b/lib/libc/sys/stat.2
@@ -1,4 +1,4 @@
-.\" $OpenBSD: stat.2,v 1.10 1999/07/05 06:08:05 aaron Exp $
+.\" $OpenBSD: stat.2,v 1.11 1999/12/04 22:16:39 aaron Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@@ -75,7 +75,8 @@ Instead, these attributes are taken from the directory that
contains the link.
The only attributes returned from an
.Fn lstat
-that refer to the symbolic link itself are the file type (S_IFLNK),
+that refer to the symbolic link itself are the file type
+.Pq Dv S_IFLNK ,
size, blocks, and link count (always 1).
.Pp
The
@@ -117,7 +118,7 @@ The time-related fields of
.Li struct stat
are as follows:
.Bl -tag -width XXXst_mtime
-.It st_atime
+.It Fa st_atime
Time when file data was last accessed.
Changed by the
.Xr mknod 2 ,
@@ -125,7 +126,7 @@ Changed by the
and
.Xr read 2
system calls.
-.It st_mtime
+.It Fa st_mtime
Time when file data was last modified.
Changed by the
.Xr mknod 2 ,
@@ -133,7 +134,7 @@ Changed by the
and
.Xr write 2
system calls.
-.It st_ctime
+.It Fa st_ctime
Time when file status was last changed (inode data modification).
Changed by the
.Xr chmod 2 ,
@@ -152,9 +153,9 @@ The size-related fields of the
.Li struct stat
are as follows:
.Bl -tag -width XXXst_blksize
-.It st_blksize
+.It Fa st_blksize
The optimal I/O block size for the file.
-.It st_blocks
+.It Fa st_blocks
The actual number of blocks allocated for the file in 512-byte units.
As short symbolic links are stored in the inode, this number may
be zero.
@@ -164,21 +165,21 @@ The status information word
.Fa st_mode
has the following bits:
.Bd -literal
-#define S_IFMT 0170000 /* type of file */
-#define S_IFIFO 0010000 /* named pipe (fifo) */
-#define S_IFCHR 0020000 /* character special */
-#define S_IFDIR 0040000 /* directory */
-#define S_IFBLK 0060000 /* block special */
-#define S_IFREG 0100000 /* regular */
-#define S_IFLNK 0120000 /* symbolic link */
-#define S_IFSOCK 0140000 /* socket */
-#define S_IFWHT 0160000 /* whiteout */
-#define S_ISUID 0004000 /* set user id on execution */
-#define S_ISGID 0002000 /* set group id on execution */
-#define S_ISVTX 0001000 /* save swapped text even after use */
-#define S_IRUSR 0000400 /* read permission, owner */
-#define S_IWUSR 0000200 /* write permission, owner */
-#define S_IXUSR 0000100 /* execute/search permission, owner */
+#define S_IFMT 0170000 /* type of file */
+#define S_IFIFO 0010000 /* named pipe (fifo) */
+#define S_IFCHR 0020000 /* character special */
+#define S_IFDIR 0040000 /* directory */
+#define S_IFBLK 0060000 /* block special */
+#define S_IFREG 0100000 /* regular */
+#define S_IFLNK 0120000 /* symbolic link */
+#define S_IFSOCK 0140000 /* socket */
+#define S_IFWHT 0160000 /* whiteout */
+#define S_ISUID 0004000 /* set user id on execution */
+#define S_ISGID 0002000 /* set group id on execution */
+#define S_ISVTX 0001000 /* save swapped text even after use */
+#define S_IRUSR 0000400 /* read permission, owner */
+#define S_IWUSR 0000200 /* write permission, owner */
+#define S_IXUSR 0000100 /* execute/search permission, owner */
.Ed
.Pp
For a list of access modes, see
@@ -193,14 +194,14 @@ Otherwise, a value of \-1 is returned and
is set to indicate the error.
.Sh COMPATIBILITY
Previous versions of the system used different types for the
-.Li st_dev ,
-.Li st_uid ,
-.Li st_gid ,
-.Li st_rdev ,
-.Li st_size ,
-.Li st_blksize
+.Fa st_dev ,
+.Fa st_uid ,
+.Fa st_gid ,
+.Fa st_rdev ,
+.Fa st_size ,
+.Fa st_blksize
and
-.Li st_blocks
+.Fa st_blocks
fields.
.Sh ERRORS
.Fn stat
@@ -212,9 +213,9 @@ will fail if:
A component of the path prefix is not a directory.
.It Bq Er ENAMETOOLONG
A component of a pathname exceeded
-.Dv {NAME_MAX}
+.Dv NAME_MAX
characters, or an entire path name exceeded
-.Dv {PATH_MAX}
+.Dv PATH_MAX
characters.
.It Bq Er ENOENT
The named file does not exist.