Mail Archives: djgpp-workers/1997/09/16/03:56:45
On Mon, 15 Sep 1997, Eli Zaretskii wrote:
> You have overlooked that ARG_MAX is a macro that calls `sysconf'. Look
> at the beginning of xargs.c
I did, but either I cannot understand the code or you have
overlooked it or we are speaking about different xargs (I use
xargs from find41s.zip). The code at the beginning of xargs.c
is the following (only the relevant part):
---------------------------------------------------------------
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <signal.h>
#if !defined(SIGCHLD) && defined(SIGCLD)
#define SIGCHLD SIGCLD
#endif
/* COMPAT: SYSV version defaults size (and has a max value of) to 470.
We try to make it as large as possible. */
#if !defined(ARG_MAX) && defined(_SC_ARG_MAX)
#define ARG_MAX sysconf (_SC_ARG_MAX)
#endif
#ifndef ARG_MAX
#define ARG_MAX NCARGS
#endif
-------------------------------------------------------
And of course this file includes config.h which includes
sys/config.h where HAVE_LIMITS_H is defined to 1. In
limits.h is ARG_MAX defined so the line with defining
ARG_MAX to use sysconf is never reached.
Of course I would agree also to use sysconf for determining
the actual values, but I think this should be done then
in limits.h.
> I think patching `sysconf' is the way to go.
When defining ARG_MAX to use sysconf in limits.h this
would be the solution.
Robert
- Raw text -