From owner-freebsd-hackers Thu Sep 28 15:14:21 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from mailhost.tue.nl (mailhost.tue.nl [131.155.2.5]) by hub.freebsd.org (Postfix) with ESMTP id 577F337B43C for ; Thu, 28 Sep 2000 15:13:53 -0700 (PDT) Received: from hermes.tue.nl (hermes.tue.nl [131.155.2.46]) by mailhost.tue.nl (8.11.0/8.11.0) with ESMTP id e8SMDpQ29861 for ; Fri, 29 Sep 2000 00:13:51 +0200 (MDT) Received: from deathstar (n186.dial.tue.nl [131.155.209.185]) by hermes.tue.nl (Postfix) with ESMTP id 3FE222E803 for ; Fri, 29 Sep 2000 00:13:50 +0200 (CEST) From: "Marco van de Voort" To: freebsd-hackers@freebsd.org Date: Fri, 29 Sep 2000 00:15:24 +0100 Subject: Re: misc freebsd-internal questions. 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 +0200 X-mailer: Pegasus Mail for Win32 (v3.12b) Message-Id: <20000928221350.3FE222E803@hermes.tue.nl> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > If it is for a compile-time check, there's a __FreeBSD_version define in > (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