find: use sysconf(_SC_ARG_MAX) to determine the command-line size limit
authorDenys Vlasenko <vda.linux@googlemail.com>
Sun, 22 Jun 2014 11:54:40 +0000 (13:54 +0200)
committerDenys Vlasenko <vda.linux@googlemail.com>
Sun, 22 Jun 2014 11:54:40 +0000 (13:54 +0200)
commitf92f1d0181853b989f9377debb56902e3e21c9a8
tree14c0bb888dea4b92e0f8dcaec2aa9c2a40eb3966
parent6be3a5242ce4855734a4cdd5770b6ea7adaf2b3d
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>
findutils/find.c
findutils/xargs.c
include/libbb.h
libbb/Kbuild.src
libbb/sysconf.c [new file with mode: 0644]