projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8723a94
)
explain why we use mmap instead of malloc
author
Denis Vlasenko
<vda.linux@googlemail.com>
Sun, 2 Dec 2007 07:18:29 +0000
(07:18 -0000)
committer
Denis Vlasenko
<vda.linux@googlemail.com>
Sun, 2 Dec 2007 07:18:29 +0000
(07:18 -0000)
libbb/copyfd.c
patch
|
blob
|
history
diff --git
a/libbb/copyfd.c
b/libbb/copyfd.c
index ed383ae289173ec945e528066b6bb87af8085b6a..08bc6f8dfd7cea500550685bd548bd4151940f41 100644
(file)
--- a/
libbb/copyfd.c
+++ b/
libbb/copyfd.c
@@
-22,6
+22,8
@@
static off_t bb_full_fd_action(int src_fd, int dst_fd, off_t size)
char *buffer;
int buffer_size;
+ /* 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,