Introduce FEATURE_COPYBUF_KB.
People who want smaller stack at any cost may use it
to reduce cp's stack usage (FEATURE_COPYBUF_KB=1).
Desktop people may get faster copy of big files
(FEATURE_COPYBUF_KB=32 is ~30% faster than 4kb)
diff --git a/libbb/Config.in b/libbb/Config.in
index 5055015..6bbeffb 100644
--- a/libbb/Config.in
+++ b/libbb/Config.in
@@ -110,6 +110,16 @@
Setting this option allows for prompts to use things like \w and
\$ and escape codes.
+config FEATURE_COPYBUF_KB
+ int "Copy buffer size, in kilobytes"
+ range 1 1024
+ default 4
+ help
+ Size of buffer used by cp, mv, install etc.
+ Buffers which are 4 kb or less will be allocated on stack.
+ Bigger buffers will be allocated with mmap, with fallback to 4 kb
+ stack buffer if mmap fails.
+
config MONOTONIC_SYSCALL
bool "Use clock_gettime(CLOCK_MONOTONIC) syscall"
default y