From owner-freebsd-current Mon Apr 23 15:52:42 2001 Delivered-To: freebsd-current@freebsd.org Received: from Awfulhak.org (awfulhak.demon.co.uk [194.222.196.252]) by hub.freebsd.org (Postfix) with ESMTP id DBB1C37B62D for ; Mon, 23 Apr 2001 15:52:34 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [172.16.0.12]) by Awfulhak.org (8.11.3/8.11.3) with ESMTP id f3NM0ju03753 for ; Mon, 23 Apr 2001 23:05:46 +0100 (BST) (envelope-from brian@lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.3/8.11.3) with ESMTP id f3NM25607648; Mon, 23 Apr 2001 23:02:05 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200104232202.f3NM25607648@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.3.1 01/18/2001 with nmh-1.0.4 To: freebsd-current@FreeBSD.ORG Cc: brian@Awfulhak.org Subject: Re: cp -d dir patch for review (or 'xargs'?) In-Reply-To: Message from Oliver Fromme of "Mon, 23 Apr 2001 15:08:27 +0200." <200104231308.PAA18220@lurza.secnetix.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Date: Mon, 23 Apr 2001 23:02:05 +0100 From: Brian Somers Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Rodney W. Grimes 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 le= ngth pro- > > vided to utility. The sum of the length of the utility = name and > > the arguments passed to utility (including NULL termina= tors) will > > be less than or equal to this number. The current defa= ult 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. Unless xargs runs a command with lots of arguments and that command = increases the environment size then tries to run another command with = the same arguments - bang (E2BIG). > Regards > Oliver > = > -- = > Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 M=FCnchen > 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) -- = Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message