NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/43063: Please delete __NetBSD_Prereq__() from <sys/param.h>



The following reply was made to PR kern/43063; it has been noted by GNATS.

From: David Holland <dholland-bugs%netbsd.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: kern/43063: Please delete __NetBSD_Prereq__() from
        <sys/param.h>
Date: Sun, 28 Mar 2010 19:01:07 +0000

 On Sun, Mar 28, 2010 at 09:55:02AM +0000, Robert Elz wrote:
  > An application that looks at __NetBSD_Version__ from <sys/param.h>
  > and decides that means it is 5.99.* and so "just knows" that time_t
  > is 64 bits, or whatever else current has that's different from
  > older systems is then going to get a shock when time() (and all the
  > time fields in kernel interface structs) keep on being 32 bits
  > using the compat interfaces into the kernel.
 
 Well... if you install a sys/param.h that says 5.99.* into
 /usr/include (and presumably other kernel headers) and don't rebuild
 libc accordingly, there'll be a lot of shocks, compared to which bad
 version tests are fairly minor.
 
 Checking what's in sys/param.h (as opposed to calling uname()) is in
 fact the best way to test the version of the userland libs you have...
 
  >  So, for now, I think I'd suggest just deleting the worse than useless
  >  __NetBSD_Prereq__ macro, and just wait to see if anything else is needed
  >  rather than presuming that something will be.
 
 Well, I just ran into a case; emacs20 broke on -current because of the
 terminfo merge. It can't probe whether it's using terminfo; it has to
 be told, and so I needed a test for NetBSD < 5.99.24. It turned out to
 be necessary because of unrelated emacs lossage to get the OS version
 from the pkgsrc infrastructure instead of using sys/param.h, but
 sys/param.h would have been the better/simpler approach.
 
 (Patching in a configure test is the *right* way, but quite a bit too
 involved.)
 
 -- 
 David A. Holland
 dholland%netbsd.org@localhost
 


Home | Main Index | Thread Index | Old Index