busybox/libbb/sysconf.c
Denys Vlasenko f92f1d0181 find: use sysconf(_SC_ARG_MAX) to determine the command-line size limit
The find utility uses a hardcoded value of 32 * 1024 as the limit of
the command-line length when calling 'find -exec ... {} +'. This results
in over 4 times more execve() calls than in coreutils' find.

This patch uses the limit defined in system headers.

Based on the patch by  Bartosz Golaszewski <bartekgola@gmail.com>.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2014-06-22 13:54:40 +02:00

17 lines
337 B
C

/* vi: set sw=4 ts=4: */
/*
* Various system configuration helpers.
*
* Copyright (C) 2014 Bartosz Golaszewski <bartekgola@gmail.com>
*
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
#include "libbb.h"
#if defined _SC_ARG_MAX
unsigned FAST_FUNC bb_arg_max(void)
{
return sysconf(_SC_ARG_MAX);
}
#endif