pkgsrc-Users archive

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

"fs.c:80: error: storage size of 's' isn't known"



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

Attachment: pgpwJyATedD_u.pgp
Description: PGP signature



Home | Main Index | Thread Index | Old Index