Subject: Re: query netbsd version
To: Christoph Egger <>
From: Sean Davis <>
List: current-users
Date: 10/18/2003 11:27:03
On Sat, Oct 18, 2003 at 04:45:33PM +0200, Christoph Egger wrote:
> HI!
> I have #defined _POSIX_C_SOURCE and this results in an
> implicit declaration of function 'strdup'
> in NetBSD 1.6_STABLE.
> I don't get this warning in -current.
> Is there a way to query the NetBSD version (i.e. via a libc header macro) ?

Well, you could either include sys/param.h and look at __NetBSD_Version__ or
use uname(3)...

The former would be easier for using in an #ifdef, since the latter gives
you a struct, not a plain number.

There might be other methods, but those are the two that came to mind right


/~\ The ASCII
\ / Ribbon Campaign                   Sean Davis
 X  Against HTML                       aka dive
/ \ Email!