Subject: Re: Detecting statvfs without autoconf
To: Hubert Feyrer <hubert@feyrer.de>
From: Christoph Kaegi <kgc@zhwin.ch>
List: tech-userlevel
Date: 01/05/2006 12:26:07
On 05.01-09:44, Hubert Feyrer wrote:
> >What is the best way (i.e. most automatic way) for deciding which
> >one to use? I don't want to use autoconf at this time.
>
> Um, #include <sys/param.h> and then find the right value of
> __NetBSD_Version__ to check against...
>
> #if __NetBSD_Version__ <= 200030000
> statfs()
> #else
> statvfs()
> #endif
>
Thanks! I went for:
#if defined(SOLARIS) || __NetBSD_Version__ >= 300000000
# include <sys/types.h>
# include <sys/statvfs.h>
#else
# include <sys/param.h>
# include <sys/mount.h>
#endif
Regards
Christoph
--
----------------------------------------------------------------------
Christoph Kaegi kgc@zhwin.ch
----------------------------------------------------------------------