Date: Fri, 29 Sep 2000 00:15:24 +0100 From: "Marco van de Voort" <marcov@stack.nl> To: freebsd-hackers@freebsd.org Subject: Re: misc freebsd-internal questions. Message-ID: <20000928221350.3FE222E803@hermes.tue.nl> In-Reply-To: <20000928170059.C5729@ringwraith.office1.bg> References: <39D349C6.A89C9340@qualys.com>; from mux@qualys.com on Thu, Sep 28, 2000 at 03:38:15PM %2B0200
next in thread | previous in thread | raw e-mail | index | archive | help
> 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 (MarcoV@Stack.nl or marco@freepascal.org) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000928221350.3FE222E803>