Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/sys No file system I know of reports directory size...



details:   https://anonhg.NetBSD.org/src/rev/0fcf5d7ef743
branches:  trunk
changeset: 759040:0fcf5d7ef743
user:      dholland <dholland%NetBSD.org@localhost>
date:      Thu Nov 25 20:53:23 2010 +0000

description:
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.

diffstat:

 lib/libc/sys/stat.2 |  15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diffs (36 lines):

diff -r fc163f1b4926 -r 0fcf5d7ef743 lib/libc/sys/stat.2
--- a/lib/libc/sys/stat.2       Thu Nov 25 17:59:02 2010 +0000
+++ b/lib/libc/sys/stat.2       Thu Nov 25 20:53:23 2010 +0000
@@ -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



Home | Main Index | Thread Index | Old Index