findutils-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Findutils-patches] ./configure-time setting of default arg size


From: Eric Blake
Subject: [Findutils-patches] ./configure-time setting of default arg size
Date: Thu, 26 Jul 2007 06:41:46 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.5) Gecko/20070716 Thunderbird/2.0.0.5 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

OK to commit?

2007-07-26  Eric Blake  <address@hidden>

        Allow platforms to choose default arg size, Savannah bug #20594.
        * configure.ac (DEFAULT_ARG_SIZE): Check environment for a default
        size override.
        * lib/buildcmd.c (bc_use_sensible_arg_max): Use default size from
        configure, if requested.
        * NEWS: Document the change.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGqJaK84KuGfSFAYARApFGAKCRs4/G9IG1kW6ZZhkmJjlcukCcBwCeL8FW
hx/vJQ/ymq6DLi07+Ijbd3M=
=Grmy
-----END PGP SIGNATURE-----
Index: NEWS
===================================================================
RCS file: /sources/findutils/findutils/NEWS,v
retrieving revision 1.198
diff -u -p -r1.198 NEWS
--- NEWS        22 Jul 2007 13:52:51 -0000      1.198
+++ NEWS        26 Jul 2007 12:39:05 -0000
@@ -26,6 +26,9 @@ does not follow the POSIX rules of doing
 updatedb, frcode and code now complies with the GNU Project's coding
 standards.
 
+#20594: Allow fine-tuning of the default argument size used by xargs
+and find at ./configure time.
+
 ** Documentation Fixes
 
 Point out more explicitly that the subsecond timestamp support
Index: lib/buildcmd.c
===================================================================
RCS file: /sources/findutils/findutils/lib/buildcmd.c,v
retrieving revision 1.27
diff -u -p -r1.27 buildcmd.c
--- lib/buildcmd.c      2 Jul 2007 08:25:43 -0000       1.27
+++ lib/buildcmd.c      26 Jul 2007 12:39:05 -0000
@@ -500,7 +500,11 @@ bc_init_controlinfo(struct buildcmd_cont
 void
 bc_use_sensible_arg_max(struct buildcmd_control *ctl)
 {
+#ifdef ARG_SIZE
+  enum { arg_size = ARG_SIZE };
+#else
   enum { arg_size = (128u * 1024u) };
+#endif
   
   /* Check against the upper and lower limits. */  
   if (arg_size > ctl->posix_arg_size_max)
@@ -547,4 +551,3 @@ bc_clear_args(const struct buildcmd_cont
   state->todo = 0;
   state->dirfd = -1;
 }
-
Index: configure.ac
===================================================================
RCS file: /sources/findutils/findutils/configure.ac,v
retrieving revision 1.1
diff -u -p -b -r1.1 configure.ac
--- configure.ac        18 Jul 2007 03:40:46 -0000      1.1
+++ configure.ac        26 Jul 2007 12:39:16 -0000
@@ -61,6 +61,13 @@ else
    AC_DEFINE(LEAF_OPTIMISATION, 1, [Define if you want to use the leaf 
optimisation (this can still be turned off with -noleaf)])
 fi
 
+AC_ARG_VAR([DEFAULT_ARG_SIZE], [Default size of arguments to child processes
+of find and xargs, 128k if unspecified])
+if test -n "$DEFAULT_ARG_SIZE"; then
+   AC_DEFINE_UNQUOTED([ARG_SIZE], [$DEFAULT_ARG_SIZE],
+     [If defined, the default maximum argument size used in child processes])
+fi
+
 
 
 dnl Checks for programs.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]