Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jun 2005 12:13:58 +0200
From:      Adriaan de Groot <groot@kde.org>
To:        freebsd-amd64@freebsd.org
Subject:   Re: sript (Perl) test code needed (was: How to build JDK15 on AMD64 with FreeBSD?)
Message-ID:  <200506301213.58569.groot@kde.org>
In-Reply-To: <20050629221047.GC20836@dragon.NUXI.org>
References:  <42BC8310.9040501@cse.unl.edu> <20050626042355.GA41119@misty.eyesbeyond.com> <20050629221047.GC20836@dragon.NUXI.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 30 June 2005 00:10, David O'Brien wrote:
> On Sat, Jun 25, 2005 at 10:23:56PM -0600, Greg Lewis wrote:
> > and follow the instructions.  There is one caveat on amd64 -- one of the
> > build commands will fail strangely (this is a bug in the Linux emulation
> > on amd64 as far as I can determine).
>
> I know this should be trivial to do in perl and maybe someone here has the
> time to hack it up.  I want a small test script (actually some other
> scripting language than perl preferred).

> The script should run the following commands until an error is returned:
> and when the error occurs print out the length of the command line.
> I want to get the bottom of the "command too long" issue that causes too
> much trouble deploying Java on FreeBSD/AMD64.

Well, in the setup you posit here, you run into the maximum file-name length 
of 1024 well before you run into the length of the maximum command-line 
(kern.argmax). The following quick test tests the maximum command-line (it's 
a lot like the autoconf test for maximum command-line length);

#! /usr/bin/env perl

@what = ( "././././././././" );

while ( 0 == system( "ls",@what)  )
{
        push(@what , @what);
        print STDERR "Length " . (@what + 0) . "\n";
}

It stops after printing Length 4096, so 2+4096*16 bytes of command-line is too 
much (and indeed, my kern.argmax is 65536) (hm, does a NUL terminating byte 
count towards argmax?).

Doing something more subtle finishes at Length 3776 (* 16 bytes, possibly 17 
-- in any case less that 65536).



-- 
These are your friends - Adem
    GPG: FEA2 A3FE Adriaan de Groot



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