From owner-freebsd-questions Thu Nov 16 15:42: 3 2000 Delivered-To: freebsd-questions@freebsd.org Received: from implode.root.com (root.com [209.102.106.178]) by hub.freebsd.org (Postfix) with ESMTP id 3F03937B4C5 for ; Thu, 16 Nov 2000 15:42:01 -0800 (PST) Received: from implode.root.com (localhost [127.0.0.1]) by implode.root.com (8.8.8/8.8.5) with ESMTP id PAA01064; Thu, 16 Nov 2000 15:41:21 -0800 (PST) Message-Id: <200011162341.PAA01064@implode.root.com> To: Sebastiaan van Erk Cc: Alfred Perlstein , freebsd-questions@FreeBSD.ORG Subject: Re: argument list too long In-reply-to: Your message of "Fri, 17 Nov 2000 00:13:28 +0100." <20001117001328.A87281@sebster.com> From: David Greenman Reply-To: dg@root.com Date: Thu, 16 Nov 2000 15:41:21 -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >The point that I'm trying to make is that it's an _arbitrary_ restriction. >There is no _reason_ for it. It sounds to me like all the other _arbitrary_ Actually, it's not arbitrary at all. There are very good reasons why it is the way it is. For one thing, the arguments are stored above the user stack and all of them have to be programatically addressable, so that limits you right away to something that is quite a bit less than infinite. The real limit has to do with the need to copy the arguments into the kernel's virtual address space when an exec() is done - the kernel must replace the address space with a new one and has to make a copy of the arguments to do that. A limit of 64k was chosen so that the kernel VM usage could be kept under control (many processes can exec() simultaneously in FreeBSD, and each one can eat 64K of VM). You could save some space by serializing the exec()'s, but this results in a significant loss of performance for only a marginal gain. The bottom line is that the limitation comes from many different areas - the hardware architecture itself, the API, and from the implementation. While we could make the arglist larger, it wouldn't be anything but a bandaid and your program would still fail with the larger list. Use xargs. That's why it's there. -DG David Greenman Co-founder, The FreeBSD Project - http://www.freebsd.org President, TeraSolutions, Inc. - http://www.terasolutions.com Pave the road of life with opportunities. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message