Skip to content

Fix openbsd compile errors

ToMe25 requested to merge ToMe25/libgtop:openbsd_fixes into master

This Merge Request fixes the build errors in the openbsd sysdeps.

Fixes

Fix #57 (closed) by implementing the workaround from there.

Fix sysdeps/openbsd/procmap.c by changing tree handling from RB to RBT.

Copy sysdeps/stub/procio.c to sysdeps/openbsd/procio.c to allow the library to be built.

Fix sysdeps/openbsd/netload.c compilation errors by moving _KERNEL definition before the if_var include.

Fix startup crash by using file mode KVM_NO_FILES in kvm_openfiles.

Fix startup errors in sysdeps/openbsd/shm_limits.c, sysdeps/openbsd/sem_limits.c, and sysdeps/openbsd/msg_limits.c by applying the openbsd patches for those files. - Implemented by robert <robert@openbsd.org> and jasper <jasper@openbsd.org>(written like this to not needlessly ping them).

WARNING: Compiling libgtop with this MR works, however the libgtop resulting from that doesn't.

Notes

This MR is intended to make libgtop compile on openbsd without breaking things that worked before.
It is not intended to result in a fully working build, as this would require way more knowledge of various things then i have.

There are some OpenBSD port patches here.
However some of them seem questionable.
Because i am not really able to judge which ones can reasonably be used i decided not to use as few as possible of them.
The only ones i added the are the ones for sysdeps/openbsd/shm_limits.c, sysdeps/openbsd/sem_limits.c, and sysdeps/openbsd/msg_limits.c because they do pretty much what i would have done anyways.
If adding them is an issue, let me know.
Its not much effort to remove them again.

This MR currently causes gnome-system-monitor(the program i used for testing) to crash on startup.
I can not fix this without drastic measures, so i wont.
Commenting out all occurrences of kvm_nlist and kvm_read in sysdeps/openbsd/ppp.c and sysdeps/openbsd/netload.c will make the system monitor start.
But the obviously the things that needed the info from these kvm actions don't work then.

Building libgtop with this MR only works with gmake, not the default openbsd make.

The distcheck build target also doesn't work at all, but this is because of something i don't think i can change.

Edited by ToMe25

Merge request reports