From owner-freebsd-questions Thu Nov 16 15: 9:14 2000 Delivered-To: freebsd-questions@freebsd.org Received: from heinz.jollem.com (c187104187.telekabel.chello.nl [212.187.104.187]) by hub.freebsd.org (Postfix) with ESMTP id 8BF2437B4FE for ; Thu, 16 Nov 2000 15:09:06 -0800 (PST) Received: (from ernst@localhost) by heinz.jollem.com (8.11.1/8.9.3) id eAGN8Gp15718; Fri, 17 Nov 2000 00:08:16 +0100 (CET) (envelope-from ernst) Date: Fri, 17 Nov 2000 00:08:16 +0100 From: Ernst de Haan To: Alfred Perlstein Cc: Sebastiaan van Erk , Zero Sum , freebsd-questions@FreeBSD.ORG Subject: Re: argument list too long Message-ID: <20001117000816.B15150@c187104187.telekabel.chello.nl> References: <20001116091607.A97857@sebster.com> <00111621362707.00522@shalimar.net.au> <20001116122313.A69018@sebster.com> <00111700205500.61931@shalimar.net.au> <20001116145641.A22842@sebster.com> <20001116105654.G830@fw.wintelcom.net> <20001116231731.A14470@c187104187.telekabel.chello.nl> <20001116143843.S830@fw.wintelcom.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <20001116143843.S830@fw.wintelcom.net>; from bright@wintelcom.net on Thu, Nov 16, 2000 at 02:38:43PM -0800 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Alfred, Alfred Perlstein wrote: > * Ernst de Haan [001116 14:18] wrote: > > > Can you please suggest a reasonable limit to the argument list? > > > > You don't get the point. In Sebastiaan's opinion there should be no fixed > > limit. I assume you never worked with variable-size data types? Linked lists > > are the simplest form. But so are resizing arrays. > > I'd like to see what Linux does when you try to run this: > > ls -l `find /` I don't know about Leenucks. I don't have it running here. > Assuming it doesn't crash your Linux box, go complain to Linus > about expanding the max system arglist size, if it does crash > your box, well then I guess you don't have anything to complain > about, do you? Why are you coming up with Linux and Linus? What do those have to do with the problem? (or `challenge' rather!) We're talking about FreeBSD here, remember? Do you understand that the data type used to hold the argument list for a program can be extended if needed? Have you ever worked with linked lists > There exists kernel APIs for determining the max arg list size. Why impose an arbitrary restriction? In the old days, with limited memory, the small overhead imposed by using variable sized data structures may have been very important, but today we have the opportunity to improve the quality of FreeBSD by making use of modern features and techniques. Perhaps a small code example will help. Suppose this is our old design: int i; int MAX_ARGUMENTS = 2048; char *arguments[] = (char **) malloc (MAX_ARGUMENTS * sizeof(char *)); : for (i=0; i Coders that assume inifinite memory are fooling themselves and > need to learn how to code properly. Sure, but so are coders that assume very limited memory! :) Ernst > -- > -Alfred Perlstein - [bright@wintelcom.net|alfred@freebsd.org] > "I have the heart of a child; I keep it in a jar on my desk." > To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message