Module Name: src
Committed By: dholland
Date: Thu Nov 25 20:53:23 UTC 2010
Modified Files:
src/lib/libc/sys: stat.2
Log Message:
No file system I know of reports directory sizes that are multiples of
sizeof(struct dirent) except by accident. So, sync with reality. Brought
to my attention by Taylor R Campbell in chat.
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/lib/libc/sys/stat.2
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/sys/stat.2
diff -u src/lib/libc/sys/stat.2:1.46 src/lib/libc/sys/stat.2:1.47
--- src/lib/libc/sys/stat.2:1.46 Fri Jun 4 05:42:24 2010
+++ src/lib/libc/sys/stat.2 Thu Nov 25 20:53:23 2010
@@ -1,4 +1,4 @@
-.\" $NetBSD: stat.2,v 1.46 2010/06/04 05:42:24 jruoho Exp $
+.\" $NetBSD: stat.2,v 1.47 2010/11/25 20:53:23 dholland Exp $
.\"
.\" Copyright (c) 1980, 1991, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)stat.2 8.4 (Berkeley) 5/1/95
.\"
-.Dd June 4, 2010
+.Dd November 25, 2010
.Dt STAT 2
.Os
.Sh NAME
@@ -152,11 +152,12 @@
.Bl -tag -width st_blksize -offset indent
.It Va st_size
The size of the file in bytes.
-A directory will be a multiple of the size of the
-.Xr dirent 3
-structure.
-Some file systems (notably ZFS) return the number of entries in the directory
-instead of the size in bytes.
+The meaning of the size reported for a directory is file system
+dependent.
+Some file systems (e.g. FFS) return the total size used for the
+directory metadata, possibly including free slots; others (notably
+ZFS) return the number of entries in the directory.
+Some may also return other things or always report zero.
.It Va st_blksize
The optimal I/O block size for the file.
.It Va st_blocks