Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 23 Apr 2001 15:08:27 +0200 (CEST)
From:      Oliver Fromme <olli@secnetix.de>
To:        freebsd-current@FreeBSD.ORG
Subject:   Re: cp -d dir patch for review (or 'xargs'?)
Message-ID:  <200104231308.PAA18220@lurza.secnetix.de>
In-Reply-To: <200104230521.WAA76392@gndrsh.dnsmgr.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Rodney W. Grimes <freebsd@gndrsh.dnsmgr.net> wrote:
 > > Before anyone starts writing scripts, consider that {} will be 
 > > replaced by xargs with (roughly) ARG_MAX - 10 characters worth of the 
 > > stuff coming off the pipe.  If your combined arguments plus 
 > > environment exceeds ARG_MAX execve(2) will give you E2BIG.
 > 
 > No rain here, it is ARG_MAX - 2048:
 >      -s size
 >              Set the maximum number of bytes for the command line length pro-
 >              vided to utility. The sum of the length of the utility name and
 >              the arguments passed to utility (including NULL terminators) will
 >              be less than or equal to this number.  The current default value
 >              for size is ARG_MAX - 2048.
 > 
 > 2K would be a pretty big env, root default std is about 367 bytes.
 > 
 > Yes, that is probably not a portable assumption to make, but it is
 > far better than using non-standard options to xargs.

If I'm not mistaken, the size of the environment is already
taken into account by the xargs utility (subtracted from
ARG_MAX).  So this isn't an issue at all.

Regards
   Oliver

-- 
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"All that we see or seem is just a dream within a dream" (E. A. Poe)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200104231308.PAA18220>