summaryrefslogtreecommitdiffstats
path: root/lib/crc32_file.c
diff options
context:
space:
mode:
authorUlf Hermann <[email protected]>2017-02-15 15:28:38 +0100
committerMark Wielaard <[email protected]>2017-02-15 15:32:45 +0100
commitcb379c4d7859848572c224f7bebd107b02adcfd6 (patch)
tree0b75974d35218d57f796574c0507f1b04a4bc430 /lib/crc32_file.c
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 <[email protected]>
Diffstat (limited to 'lib/crc32_file.c')
-rw-r--r--lib/crc32_file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/crc32_file.c b/lib/crc32_file.c
index 57e42980..f7607d0b 100644
--- a/lib/crc32_file.c
+++ b/lib/crc32_file.c
@@ -53,7 +53,7 @@ crc32_file (int fd, uint32_t *resp)
void *mapped = mmap (NULL, mapsize, PROT_READ, MAP_PRIVATE, fd, 0);
if (mapped == MAP_FAILED && errno == ENOMEM)
{
- const size_t pagesize = sysconf (_SC_PAGE_SIZE);
+ const size_t pagesize = sysconf (_SC_PAGESIZE);
mapsize = ((mapsize / 2) + pagesize - 1) & -pagesize;
while (mapsize >= pagesize
&& (mapped = mmap (NULL, mapsize, PROT_READ, MAP_PRIVATE,