When sysconf() returns -1 for a limit, that means the limit is
"unspecified". In that case, choose 2M for SC_ARG_MAX instead of the
POSIX minimum, matching (somewhat arbitrarily) the value on a current
16GB Debian amd64 system.
The POSIX minimum was unnecessary, likely inefficient, and causing
unnecessary failures.
Thanks to Mark J Hewitt <m.hewitt@computer.org> for reporting the
problem and tracking down the cause.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
assert(sc_page_size > 0)
sc_arg_max = os.sysconf('SC_ARG_MAX')
-if sc_arg_max == -1:
- sc_arg_max = 4096
+if sc_arg_max == -1: # "no definite limit" - let's choose 2M
+ sc_arg_max = 2 * 1024 * 1024
# This function should really be in helpers, not in bup.options. But we
# want options.py to be standalone so people can include it in other projects.