From owner-freebsd-bugs Fri Oct 18 3:40:13 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8F8D537B404 for ; Fri, 18 Oct 2002 03:40:10 -0700 (PDT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 74F7243EAA for ; Fri, 18 Oct 2002 03:40:09 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id g9IAe8x3013176 for ; Fri, 18 Oct 2002 03:40:08 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id g9IAe8QZ013175; Fri, 18 Oct 2002 03:40:08 -0700 (PDT) Date: Fri, 18 Oct 2002 03:40:08 -0700 (PDT) Message-Id: <200210181040.g9IAe8QZ013175@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Peter Pentchev Subject: Re: misc/44195: globbing/argument limits Reply-To: Peter Pentchev Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR misc/44195; it has been noted by GNATS. From: Peter Pentchev To: abc@anchorageinternet.org Cc: bug-followup@FreeBSD.org Subject: Re: misc/44195: globbing/argument limits Date: Fri, 18 Oct 2002 13:36:36 +0300 --GFPlsJ7YtLjXgs8j Content-Type: text/plain; charset=windows-1251 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Oct 18, 2002 at 05:40:09AM +0000, abc@anchorageinternet.org wrote: >=20 > >Number: 44195 > >Category: misc > >Synopsis: globbing/argument limits > >Originator: Joe Public > >Release: i386 FreeBSD 4.7-RELEASE > >Organization: > no org > >Environment: > ^^^^^^^^^^^^^^^^^^^^^^^^ > >Description: > argument limits painful to users in days of 100GB drives. > >How-To-Repeat: > try a command and give it a few thousand arguments, It is not a matter of how many arguments you give to a command, it is simply a matter of how *long* the command line becomes. Lugging around a multimegabyte command line buffer through shells, execv() system calls and such would be a *major* strain on your system. > like in file modifying command a folder with 6000 files. > find(1) is too slow, and combining it with xargs is a kludge. If you mean that 'find -exec' is too slow, then I would argue that using -exec is the kludge, when xargs(1) is available. I am pretty sure that the find(1) and xargs(1) utilities were actually developed together, with a common goal in mind, that goal being *exactly* processing of multiple files in one go. The -exec primary to find(1) is extremely inefficient when dealing with many files - it spawns a new process for each file it finds, which, as you note, is too slow. The xargs utility will do a much better job; I would be very interested in what exactly do you consider to be a kludge about it. > there has to be a better solution than imposing these > arbitrary limits on arguments. user limits in /etc/login.conf, > or something like that, should be used to limit use of > utilities, not compiled-in defines. As explained above, the limits are not arbitrary, but governed by strict common sense when it comes to passing buffers both between userland utilities and through multiple crossings of the userland/kernel boundary in system calls. G'luck, Peter PS. This will very probably be my last post on this subject, and nobody should be surprised if this PR is closed very soon; what with the recent mailing list "activity", it scores big on my troll indicator. I could be wrong, of course, but I'm just stating my opinion here. --=20 Peter Pentchev roam@ringlet.net roam@FreeBSD.org PGP key: http://people.FreeBSD.org/~roam/roam.key.asc Key fingerprint FDBA FD79 C26F 3C51 C95E DF9E ED18 B68D 1619 4553 This would easier understand fewer had omitted. --GFPlsJ7YtLjXgs8j Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE9r+Q07Ri2jRYZRVMRAjEmAJ9ZF0S/DEiWiTKSosxXzZ2xlHf0oQCdERmx 1UahZ2drIfteCqMkWyC3GrM= =+snq -----END PGP SIGNATURE----- --GFPlsJ7YtLjXgs8j-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message