Subject: "fs.c:80: error: storage size of 's' isn't known"
To: NetBSD/pkgsrc-users <pkgsrc-users@netbsd.org>
From: Joel CARNAT <joel@carnat.net>
List: pkgsrc-users
Date: 09/07/2006 22:55:24
--a8Wt8u1KmwUX3Y2C
Content-Type: text/plain; charset=iso-8859-15
Content-Disposition: inline
Hi,
I'm trying to get "comky" to work under NetBSD.
During compilation, the following error occurs:
########################################################################
fs.c: In function 'update_fs_stat':
fs.c:80: error: storage size of 's' isn't known
fs.c:81: warning: implicit declaration of function 'statfs'
fs.c:80: warning: unused variable 's'
*** Error code 1
########################################################################
The corresponding code is (from what I understood):
########################################################################
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
#include <sys/mount.h>
#endif
#define MAX_FS_STATS 64
static struct fs_stat fs_stats_[MAX_FS_STATS];
struct fs_stat *fs_stats = fs_stats_;
<SNIP>
static
void update_fs_stat(struct fs_stat* fs)
{
struct statfs s;
if(statfs(fs->path, &s) == 0) {
fs->size = (long long) s.f_blocks * s.f_bsize;
/* bfree (root) or bavail (non-roots) ? */
fs->avail = (long long) s.f_bavail* s.f_bsize;
fs->free = (long long) s.f_bfree * s.f_bsize;;
} else {
fs->size = 0;
fs->avail = 0;
fs->free = 0;
ERR("statfs '%s': %s", fs->path, strerror(errno));
}
}
########################################################################
I check that s.f_* exists in "struct statfs" declaration.
I don't understand which "storage size" it is talking about.
PS: it's been a while since I coded so excuse me if it is trivial ;)
TIA,
Jo
--a8Wt8u1KmwUX3Y2C
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (NetBSD)
iD8DBQFFAIc80/VH7L7F7Y4RAg4hAJ4s02MaE/03kLUapzZ8lC8z3pOjNACgiuCh
VkRrl219WgrsnGcyxqCw4ZI=
=5Okh
-----END PGP SIGNATURE-----
--a8Wt8u1KmwUX3Y2C--