summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDenys Vlasenko2020-12-14 18:25:28 +0100
committerDenys Vlasenko2020-12-14 18:25:28 +0100
commitfd3c512f88d43e6633bd3c3110cfa0bb321adaa8 (patch)
tree97211484388a0db0a85957f2e3f3724cb1c9159f /include
parentdb793480cb8ec3e5f878d1ec18b6ed5010c85e85 (diff)
downloadbusybox-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 'include')
-rw-r--r--include/libbb.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 8f1ee7e..a74b311 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -387,6 +387,9 @@ void* xrealloc_vector_helper(void *vector, unsigned sizeof_and_shift, int idx) F
char *xstrdup(const char *s) FAST_FUNC RETURNS_MALLOC;
char *xstrndup(const char *s, int n) FAST_FUNC RETURNS_MALLOC;
void *xmemdup(const void *s, int n) FAST_FUNC RETURNS_MALLOC;
+void *mmap_read(int fd, size_t size) FAST_FUNC;
+void *mmap_anon(size_t size) FAST_FUNC;
+void *xmmap_anon(size_t size) FAST_FUNC;
//TODO: supply a pointer to char[11] buffer (avoid statics)?