diff options
| author | Ulf Hermann <[email protected]> | 2017-02-15 15:28:38 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2017-02-15 15:32:45 +0100 |
| commit | cb379c4d7859848572c224f7bebd107b02adcfd6 (patch) | |
| tree | 0b75974d35218d57f796574c0507f1b04a4bc430 /lib | |
| parent | 29173849c445b178a97e400c071f25629a4f8b9f (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')
| -rw-r--r-- | lib/ChangeLog | 4 | ||||
| -rw-r--r-- | lib/crc32_file.c | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/lib/ChangeLog b/lib/ChangeLog index 5ccf4d6b..6578ddba 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,7 @@ +2017-02-15 Ulf Hermann <[email protected]> + + * crc32_file.c: Use _SC_PAGESIZE rather than _SC_PAGE_SIZE. + 2017-02-14 Ulf Hermann <[email protected]> * color.h: New file. 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, |
