[GRASS5] Re: [GRASSLIST:1960] can't find statvfs.h [r.terraflow on MaxOSX]

Hamish hamish_nospam at yahoo.com
Thu Dec 11 18:13:03 EST 2003


> > > > Or can the dependancy be written out of 
> > > >  src.contrib/DUKE/r.terraflow/main.cc
> > > > 
> > > > main.cc:#include <sys/statvfs.h>
> > > > main.cc:  struct statvfs statbuf;
> > > > main.cc:  statvfs(getenv(STREAM_TMPDIR), &statbuf);
> > > 
> > > It could be made to use statfs() instead, i.e. change:
> > ..
> > > However, statfs() is listed as a BSD 4.4 function, so some systems
> > > may have statvfs() but not statfs(). I can't find any
> > > standardisation information for statvfs(), so it's possible that
> > > some systems may have neither.
> > 
> > OSX 10.3 only has /usr/include/sys/stat.h, ie neither.
> 
> How about <mount.h> or <sys/mount.h>?


Yes, sys/mount.h

which includes:
struct statfs {
...
  long    f_bsize;  /* fundamental file system block size */
...
  long    f_bavail; /* free blocks avail to non-superuser */
...
};


changing main.cc to use that include and change calls to statvfs to
statfs works ok.


The compile still fails in fill.cc though:
...
fill.cc:231:   instantiated from here
IOStream/include/ami_sort_impl.h:206: error: could not convert `nb_runs'
to `   unsigned int&'
IOStream/include/ami_sort_impl.h:69: error: in passing argument 4 of
`void    initializeRunFormation(AMI_STREAM<T>*, size_t&, size_t&,
unsigned int&)    [with T = plateauType]'
...



Hamish




More information about the grass-dev mailing list