summaryrefslogtreecommitdiffstats
path: root/libdwfl
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2017-02-15 15:28:38 +0100
committerMark Wielaard <mark@klomp.org>2017-02-15 15:32:45 +0100
commitcb379c4d7859848572c224f7bebd107b02adcfd6 (patch)
tree0b75974d35218d57f796574c0507f1b04a4bc430 /libdwfl
parent29173849c445b178a97e400c071f25629a4f8b9f (diff)
Always use the same method to query the system page size
This makes it easier to write a replacement for it on systems where sysconf(3) doesn't exist. Signed-off-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'libdwfl')
-rw-r--r--libdwfl/ChangeLog5
-rw-r--r--libdwfl/linux-kernel-modules.c2
-rw-r--r--libdwfl/linux-proc-maps.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog
index 57671eaf..52466cc3 100644
--- a/libdwfl/ChangeLog
+++ b/libdwfl/ChangeLog
@@ -1,3 +1,8 @@
+2017-02-15 Ulf Hermann <ulf.hermann@qt.io>
+
+ * linux-kernel-modules.c: Use sysconf(_SC_PAGESIZE) to get page size.
+ * linux-proc-maps.c: Likewise.
+
2016-12-29 Luiz Angelo Daros de Luca <luizluca@gmail.com>
* dwfl_build_id_find_elf.c: Include system.h.
diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c
index 9cd8ea93..a7ac19d2 100644
--- a/libdwfl/linux-kernel-modules.c
+++ b/libdwfl/linux-kernel-modules.c
@@ -500,7 +500,7 @@ intuit_kernel_bounds (Dwarf_Addr *start, Dwarf_Addr *end, Dwarf_Addr *notes)
if (*notes == 0 && !strcmp (state.p, "__start_notes\n"))
*notes = *end;
- Dwarf_Addr round_kernel = sysconf (_SC_PAGE_SIZE);
+ Dwarf_Addr round_kernel = sysconf (_SC_PAGESIZE);
*start &= -(Dwarf_Addr) round_kernel;
*end += round_kernel - 1;
*end &= -(Dwarf_Addr) round_kernel;
diff --git a/libdwfl/linux-proc-maps.c b/libdwfl/linux-proc-maps.c
index 4ae1e74a..094dd53d 100644
--- a/libdwfl/linux-proc-maps.c
+++ b/libdwfl/linux-proc-maps.c
@@ -418,7 +418,7 @@ dwfl_linux_proc_find_elf (Dwfl_Module *mod __attribute__ ((unused)),
if (fd < 0)
goto detach;
- *elfp = elf_from_remote_memory (base, getpagesize (), NULL,
+ *elfp = elf_from_remote_memory (base, sysconf (_SC_PAGESIZE), NULL,
&read_proc_memory, &fd);
close (fd);