aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-12-02 07:18:29 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-12-02 07:18:29 +0000
commit8003e266edbc0ec62a586dd70dcc80dc13e2dbf0 (patch)
tree13ddb789e0daa7e86a2b60be9cafec2b0f108dcf
parent8723a94c2570cdf3a6baddfff7a43523470ed368 (diff)
downloadbusybox-8003e266edbc0ec62a586dd70dcc80dc13e2dbf0.tar.gz
explain why we use mmap instead of malloc
-rw-r--r--libbb/copyfd.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libbb/copyfd.c b/libbb/copyfd.c
index ed383ae28..08bc6f8df 100644
--- 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,