Py_DECREF(value);
}
#endif
- {
- PyObject *value;
- const long arg_max = sysconf(_SC_ARG_MAX);
- if (arg_max == -1)
- {
- fprintf(stderr, "Cannot find SC_ARG_MAX, please report a bug.\n");
- exit(1);
- }
- value = INTEGER_TO_PY(arg_max);
- PyObject_SetAttrString(m, "SC_ARG_MAX", value);
- Py_DECREF(value);
- }
#pragma clang diagnostic pop // ignored "-Wtautological-compare"
e = getenv("BUP_FORCE_TTY");
from bup import _helpers
+sc_arg_max = os.sysconf('SC_ARG_MAX')
+
# 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.
from bup.options import _tty_width
return sum(len(x) + 1 + sizeof(c_void_p) for x in args)
-def batchpipe(command, args, preexec_fn=None, arg_max=_helpers.SC_ARG_MAX):
+def batchpipe(command, args, preexec_fn=None, arg_max=sc_arg_max):
"""If args is not empty, yield the output produced by calling the
command list with args as a sequence of strings (It may be necessary
to return multiple strings in order to respect ARG_MAX)."""