[PATCH] Detect GNU/kFreeBSD in user-visible kernel headers

Robert Millan rmh at debian.org
Tue Nov 22 17:59:21 UTC 2011

2011/11/22 John Baldwin <jhb at freebsd.org>:
> Is __FreeBSD_version defined if __FreeBSD_kernel__ is defined on kFreeBSD?

Not currently (except for kernel-space code), but if all the checks
that use __FreeBSD_version are like the one you describe, I think it'd
make sense.

But we need to make sure that defining it wouldn't suddenly enable
code that is intended for FreeBSD userland, like it happens with

It'd also have to be discussed on Debian mailing list.  My first
impression is that defining it could be useful in some situations.  We
just don't run into this kind of situation so often, so this
possibility AFAIK has never been discussed.  I had it in my TODO to
bring it up.

Robert Millan

More information about the freebsd-current mailing list