[Lcdproc] Fix build on OpenBSD
bsdfan at nurfuerspam.de
Thu Nov 17 06:22:16 UTC 2011
On 16.11.2011 20:32, Markus Dolze wrote:
> On 16.11.2011 16:15, Edd Barrett wrote:
>> Tihs fixes the build on OpenBSD, hopefully it is correct:
> you are one of the very few users running LCDproc on OpenBSD and likely
> the first running it on 5.0 (which has just been released). Last time I
> did was OpenBSD 4.3...
> Please send in patches as attachments, not inline. Thank you.
> Regarding the patch:
> 1. Using <machine/apmvar.h> seems to be the preferred way. In old
> OpenBSD 'machine' is just a symlink to 'i386' and all man pages instruct
> to use machine/apmvar.h.
> Will commit this.
> 2. kvm_getprocs() with 5 parameters seems to be new on OpenBSD 5. Thus
> the patch will likely break any older version. There must be a check on
> either OpenBSD version or on the parameter set kvm_getprocs() accepts
> (likely in configure script).
> I'm currently not deep enough into OpenBSD to do this. Somebody else?
looking at the three BSDs and their implementation of 'struct
kinfo_proc' in lcdproc client's machine_*.c they all make it smilar, but
not exactly the same:
1. FreeBSD: kvm_getprocs() is used and it depends on OS version which
type of kinfo_proc is returned.
2. NetBSD: kvm_getproc2() and struct kinfo_proc2 are used, the result
is the same as on new FreeBSD versions.
3. OpenBSD: Use the same kvm_getprocs() and struct kinfo_proc as the
old FreeBSD are used.
You may get away with using kvm_getproc2() on OpenBSD as well, but its
use is deprecated in version 5.
More information about the LCDproc