-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PAGE_SIZE is not portable #11
Comments
Thanks for reporting this. The PAGE_SIZE macro is defined in <sys/user.h> on Linux - but apparently not on OpenBSD. A more portable version should be sysconf(_SC_PAGESIZE). I hope this is available on OpenBSD, as well. Let me set up an OpenBSD system to check. |
Hi Markus, On my OpenBSD amd64 laptop:
So you could probably fix the compilation error in this way, yes. But is the page-size baked into the PT trace somehow? If so, you'd probably want a runtime switch? Thanks |
Hi Edd, The page size is used to align mmap() mapped memory. Libipt maps code sections from binary files to decode instructions. This should be OK; sysconf(_SC_PAGESIZE) is also used in the example on the mmap(2) man page. |
Hi Markus, just found that |
This fixes #11. Change-Id: I45a62dbb10ea84e5e408532ff996b2028d85e93b Signed-off-by: Markus Metzger <markus.t.metzger@intel.com>
Thanks! |
After working around #10, I get the following compilation error on OpenBSD:
Arguably the page size should not be a compile time constant, as this means traces from different machines with different page sizes can not be decoded.
The text was updated successfully, but these errors were encountered: