diff options
author | Denys Vlasenko | 2020-12-14 18:25:28 +0100 |
---|---|---|
committer | Denys Vlasenko | 2020-12-14 18:25:28 +0100 |
commit | fd3c512f88d43e6633bd3c3110cfa0bb321adaa8 (patch) | |
tree | 97211484388a0db0a85957f2e3f3724cb1c9159f /libbb/copyfd.c | |
parent | db793480cb8ec3e5f878d1ec18b6ed5010c85e85 (diff) | |
download | busybox-fd3c512f88d43e6633bd3c3110cfa0bb321adaa8.zip 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 'libbb/copyfd.c')
-rw-r--r-- | libbb/copyfd.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/libbb/copyfd.c b/libbb/copyfd.c index d41fd10..7f9d92e 100644 --- a/libbb/copyfd.c +++ b/libbb/copyfd.c @@ -75,10 +75,7 @@ static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size) goto use_small_buf; /* We want page-aligned buffer, just in case kernel is clever * and can do page-aligned io more efficiently */ - buffer = mmap(NULL, CONFIG_FEATURE_COPYBUF_KB * 1024, - PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANON, - /* ignored: */ -1, 0); + buffer = mmap_anon(CONFIG_FEATURE_COPYBUF_KB * 1024); buffer_size = CONFIG_FEATURE_COPYBUF_KB * 1024; if (buffer == MAP_FAILED) { use_small_buf: |