mirian / cosmic.com (Mirian Crzig Lennox) wrote:
> In article <993579597.067351.15583.nullmailer / ev.netlab.zetabits.com>,
> Yukihiro Matsumoto <matz / ruby-lang.org> wrote:
> >
> >That's the cause.  Could anybody who is FreeBSD guru tell me how to
> >know the exact version of the OS?  knu?
> 
> If you type at the shell
> 	/sbin/sysctl kern.osreldate
> 
> You will get back a string of the form:
> kern.osreldate: 430000
> 
> If you divide this number by 100000, you will get the version
> number of the OS; 430000 means FreeBSD 4.3 system, 228000 means
> FreeBSD 2.28, and so on.

In addition, <osreldate.h> contains the definition:

#define __FreeBSD_version 430000

As for __FreeBSD__ not being set correctly... the stock compiler really
/should/ be setting it to the version major, and I don't remember a time 
when it wasn't (or at least wasn't meant to).

-- 
 Brian Fundakowski Feldman           \  FreeBSD: The Power to Serve!  /
 green / FreeBSD.org                    `------------------------------'