Skip site navigation (1)Skip section navigation (2)
Date:      27 Aug 2001 09:08:47 +0100
From:      Wayne Pascoe <wayne.pascoe@ehsrealtime.com>
To:        freebsd-questions@freebsd.org
Subject:   OT: Re: Porting app from Linux - sys/vfs.h replacement
Message-ID:  <86n14lj568.fsf_-_@pan.ehsrealtime.com>
In-Reply-To: <20010826162454.A12725@dan.emsphone.com>
References:  <861ylycyf7.fsf@pan.ehsrealtime.com> <20010826162454.A12725@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Dan Nelson <dnelson@emsphone.com> writes:

> > What would provide the same functionality in FreeBSD ? I particularly
> > need
> > 
> > buf.f_blocks
> > buf.f_bavail
> > buf.f_bfree
> 
> man statfs:
> 
> SYNOPSIS
>      #include <sys/param.h>
>      #include <sys/mount.h>

Thanks... I have replaced 
#include <sys/vfs.h>

with 

#include <sys/mount.h>
#include <sys/param.h>

Now when trying to build the program, I get the following error :

gcc -g -g3 -O2 spacewatcher.c -o spacewatcher
In file included from /usr/include/sys/mount.h:40,
                 from spacewatcher.c:13:
/usr/include/sys/ucred.h:47: syntax error before `u_short'
/usr/include/sys/ucred.h:50: syntax error before `gid_t'
spacewatcher.c: In function `build_alert':
spacewatcher.c:112: warning: initialization makes pointer from integer without a cast
*** Error code 1

It loks like it doesn't like u_short and gid_t ... The section from
ucred.h is as follows :

struct ucred {
    u_short cr_ref;         /* reference count */
    uid_t   cr_uid;         /* effective user id */
    short   cr_ngroups;     /* number of groups */
    gid_t   cr_groups[NGROUPS]; /* groups */
    struct  uidinfo *cr_uidinfo;    /* per uid resource consumption */
};

I have written a mostly empty c file called test.c that just looks
like 

#include <stdio.h>
#include <sys/mount.h>
#include <sys/param.h>

void main (void) {

}

It still produces the same error. Is there another header file I need
to include for this to work ?

Thanks in advance ...

-- 
Wayne Pascoe <wayne.pascoe@ehsrealtime.com>
Phone : +44 (0) 20 7017 1221

Things fall apart; the center cannot hold;
Mere anarchy is loosed upon the world. - Yeats

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?86n14lj568.fsf_-_>