Robert Story wrote:
On Mon, 09 Jan 2006 17:14:53 +0100 Thomas wrote:
TA> IRIX (32-bit) and IRIX64 (64-bit) kernels need different handling TA> (nlist() vs. nslist64()), but there doesn't seem to be an existing TA> define (we currently assume IRIX64 which doesn't exist) to make this TA> decision at compile-time. Even if there was one, a binary compiled for TA> the N32 ABI can happily run on both IRIX32 and IRIX64 systems. So why TA> not handle this at runtime instead?

I'm a fa of doing as much as possible at compile time. In this particular
case, configure should be able to detect if nlist64 is available, and if so,
it should use it. The only time it matters is when building on 64bit host, and
wanting to run the resulting binary on a 32bit host. I think this is a corner
case that can be handled by documentation in README.irix.

nlist64() is defined in IRIX in general, irrespective on whether one runs a 32-bit or 64-bit kernel, but will only work on ELF64 files (like 64-bit kernel images). So we'd bring nlist64() to people with a 32-bit *kernel* (thus breaking things) even if they compiled net-snmp on the *same* machine!

TA> net-snmp already has netsnmp_os_prematch() which seems to allow us to TA> handle platform specifics at runtime. Naturally, there's a trade-off TA> between flexibility and performance.

The problem I have with this function is that it was based on kernel version,
and assumed that specific functionality was tied with specific kernel
versions. While that might be true for closed source vendors, with open source
kernels it is not uncommon to find stuff backported from a newer kernel to an
older one. This is why I prefer configure tests that check for functionality
over run-time tests against kernel versions.

I fully understand your concerns, but I think we need to a answer a different question here. We need to determine whether we run on a 64-bit kernel, just that. Wouldn't this make a useful function to have in the code in general? (being a question to all, not just Robert)


+Thomas

--
Thomas Anders (thomas.anders at blue-cable.de)


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to