sript (Perl) test code needed (was: How to build JDK15 on AMD64 with FreeBSD?)

Adriaan de Groot groot at kde.org
Thu Jun 30 10:14:08 GMT 2005


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", at 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


More information about the freebsd-amd64 mailing list