> If it is for a compile-time check, there's a __FreeBSD_version define in
> <sys/param.h> (the kern.osreldate sysctl returns exactly this). If it is
> a configure- or run-time thing, use the sysctl as Maxime suggested.
No, it is runtime detection, and maybe it needs to be a very early
one, therefore I requested the detection via syscall. (contrary to e.g.
running uname or so).
Compile time using C headers is totally impossible, since the
compiler can't read C headers ;-)
The sysctl call is not in the man pages, which had confused me.
After Maxime's hint I started searching again, convinced that
something called sysctl had to exist on syscall level (in uname and
libc sources/headers), and found it
The runtime checks would keep both versions binary compatible as it
seems.
Even weirder is that if I generate binaries on Linux, using our
FreeBSD runtime library, the generated binaries run perfectly on
FreeBSD (no, no linux compat :-). No crosslinker needed, and the
ELF object file writer also works fine (eliminating AS)
Well, I hope to implement this tomorrow, and create the port files
next week. Thanks to the hackers list for all support!
The ENTER part is interesting (since it is slightly tighter and on
some processors faster), but not needed directly.
Marco van de Voort ([EMAIL PROTECTED] or [EMAIL PROTECTED])
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message