Re: [siesta-dev] some thoughts

[prev] [thread] [next] [lurker] [Date index for 2002/10/11]

From: Nicholas Clark
Subject: Re: [siesta-dev] some thoughts
Date: 22:50 on 11 Oct 2002
On Fri, Oct 11, 2002 at 03:57:03PM +0100, Richard Clamp wrote:
> Sure, but that's a bug in the module - it should probably construct N 
> commandlines less than the system calling limit instead.  Calling one 
> process with multiple recipients remains a win though.

You can get it like this:

#!/usr/local/bin/perl -w
use strict;

use vars '$DEFAULT_MAX_ARGS';


sub get_max_args {
  eval {
    require POSIX;
    eval { POSIX::sysconf(POSIX::_SC_ARG_MAX()) / 2 }
      || POSIX::ARG_MAX() / 2;

print "max args length is ", get_max_args(), " on this $^O machine\n";

based pretty much 100% on some code Benjamin Goldberg sent to p5p for finding
this out for MakeMaker.

It's 65536 here on Linux - my local FreeBSD box is turned off but it's half
that IIRC.

I believe that POSIX requires that the value is 4096. IIRC this is the total
space allocated to pass context to the child, which all of

* the actual text of the argv array
* the pointers to the argv array
* the environment

has to fit into.

Secondly, I believe MBM said to me that it's not portable to expect sendmail
to cope with cope with more than 100 recipients at once, and that actually
probably 80 is optimal. 100 recipients would need quite long e-mail addresses
to bust 4096, and it's clear that a SaneOS wouldn't have any problem.

(I suspect that Solaris is sane, and that if anything common insists on
inflicting only 4096 I guess it will be Irix)

Nicholas Clark
Even better than the real thing:

There's stuff above here

Generated at 13:56 on 01 Jul 2004 by mariachi 0.52