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

Re: mprotect, SIGBUS, and SIGSEGV



signal is determined by the build environment, but the next part seems
to contradict that. Is this just a wording problem (the first sentence
missing a not?) or something more subtle?

Build environment of used eglibc (MIN_KERNEL_SUPPORTED),
but not build environment of your binary.

Plain FreeBSD has a getosreldate here (as I read sbcl source[0]) right?
Maybe that could be added so this test can be kept uniformly?

Yes, but it is the version of running kernel,
but such test needs version of kernel compiled for.

Is this not what the __FreeBSD_version macro defined in param.h is intended to be used for?

There are different variations

1) version of kernel where the package (and eglibc) is run
2) version of kernel where the package have been compiled
3) version of kernel where the eglibc have been compiled
4) version of kernel headers where the package have been compiled
5) version of kernel headers where the eglibc have been compiled
6) the minimal supported kernel version advertised by current binary
7) the minimal supported kernel version advertised by eglibc library

For 6) and 7)
see "readelf -x .note.ABI-tag  --notes filename"
and "file filename"

The SIGBUS/SIGSEGV is determined by 6) and 7)
The __FreeBSD_version macro corresponds to 4).
The getosreldate() corresponds to 1).

Petr


Reply to: