delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1997/09/16/03:56:45

Date: Tue, 16 Sep 1997 09:54:07 +0200 (METDST)
From: Robert Hoehne <robert DOT hoehne AT mathematik DOT tu-chemnitz DOT de>
To: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
Cc: Oberhumer Markus <k3040e4 AT c210 DOT edvz DOT uni-linz DOT ac DOT at>,
DJGPP workers <djgpp-workers AT delorie DOT com>
Subject: Re: c1args.c patches
In-Reply-To: <Pine.SUN.3.91.970915145902.22620N-100000@is>
Message-Id: <Pine.HPP.3.95q.970916094512.14975A-100000@newton.mathematik.tu-chemnitz.de>
Mime-Version: 1.0

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019