diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2020-12-14 18:25:28 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2020-12-14 18:25:28 +0100 |
commit | fd3c512f88d43e6633bd3c3110cfa0bb321adaa8 (patch) | |
tree | 97211484388a0db0a85957f2e3f3724cb1c9159f /modutils | |
parent | db793480cb8ec3e5f878d1ec18b6ed5010c85e85 (diff) | |
download | busybox-fd3c512f88d43e6633bd3c3110cfa0bb321adaa8.tar.gz |
libbb: create and use mmap() helpers
function old new delta
mmap_anon - 22 +22
mmap_read - 21 +21
xmmap_anon - 16 +16
rpm_gettags 465 447 -18
bb_full_fd_action 498 480 -18
uevent_main 337 310 -27
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 0/3 up/down: 59/-63) Total: -4 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'modutils')
-rw-r--r-- | modutils/modutils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/modutils/modutils.c b/modutils/modutils.c index 6f7cd9721..f7ad5e805 100644 --- a/modutils/modutils.c +++ b/modutils/modutils.c @@ -169,7 +169,7 @@ void* FAST_FUNC try_to_mmap_module(const char *filename, size_t *image_size_p) /* st.st_size is off_t, we can't just pass it to mmap */ if (st.st_size <= *image_size_p) { size_t image_size = st.st_size; - image = mmap(NULL, image_size, PROT_READ, MAP_PRIVATE, fd, 0); + image = mmap_read(fd, image_size); if (image == MAP_FAILED) { image = NULL; } else if (*(uint32_t*)image != SWAP_BE32(0x7f454C46)) { |