Subject: pkg/14073: statfs() compatibility function bug in zoularis' libbsdcompat
To: None <>
From: Stoned Elipot <>
List: netbsd-bugs
Date: 09/26/2001 14:10:08
>Number:         14073
>Category:       pkg
>Synopsis:       statfs() compatibility function bug in zoularis' libbsdcompat
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 26 05:11:00 PDT 2001
>Originator:     Stoned Elipot
>Release:        current
SCRIPT, Paris VII University, France
System: SunOS deep-space-9 5.8 Generic_108528-07 sun4u sparc SUNW,Ultra-60
The compatibility function statfs() in Zoularis' ilibbsdcompat misuse
solaris' struct statvfs f_bsize member. This lead to false warning
from pkg_add while checking if enought disk space is avalaible for
Try to pkg_add a somewhat big binary package on Solaris/Zoularis, it may/will?
ask to set PKG_TMPDIR to a pathname on a FS with enough space left even if
default tempdir (/var/tmp) has already enough.

This is closely related to PR kern/2779, A similar fix was submitted in it.
Besides this PR's description is much more complete than this one :)

Index: lib/libbsdcompat/statfs.c
RCS file: /cvsroot/othersrc/zoularis/bsd/lib/libbsdcompat/statfs.c,v
retrieving revision
diff -u -r1.1.1.1 statfs.c
--- statfs.c	1999/04/12 07:43:21
+++ statfs.c	2001/09/26 11:58:11
@@ -55,8 +55,8 @@
 		sfs->f_flags |= MNT_RDONLY;
 	if (vfs->f_flag & ST_NOSUID)	
 		sfs->f_flags |= MNT_NOSUID;
-	sfs->f_bsize = vfs->f_bsize;
-	sfs->f_iosize = 8192;		/* XXX: fake */
+	sfs->f_bsize = vfs->f_frsize;
+	sfs->f_iosize = vfs->f_bsize;
 	sfs->f_blocks = vfs->f_blocks;
 	sfs->f_bfree = vfs->f_bfree;
 	sfs->f_bavail = vfs->f_bavail;