[PATCH 1/2] find: use sysconf(_SC_ARG_MAX) to determine the command-line size limit

Denys Vlasenko vda.linux at googlemail.com
Thu Jun 19 10:41:10 UTC 2014


On Wed, Jun 18, 2014 at 10:11 PM, Bartosz Golaszewski
<bartekgola at gmail.com> wrote:
> +long FAST_FUNC bb_sc_arg_max(void)
> +{
> +#if defined _SC_ARG_MAX
> +       return sysconf(_SC_ARG_MAX) - 2048;
> +#elif defined ARG_MAX
> +       return ARG_MAX - 2048;
> +#else
> +       return 32 * 1024;
> +#endif
> +}

If ARG_MAX is defined, it will be a function which returns constant.
Not optimal wrt size.


More information about the busybox mailing list