develooper Front page | perl.perl5.porters | Postings from January 2012

Re: [perl #109262] Increase the fallback value of MAXPATHLEN

Thread Previous | Thread Next
Mark Overmeer
January 29, 2012 09:01
Re: [perl #109262] Increase the fallback value of MAXPATHLEN
Message ID:
* Dominic Hargreaves ( [120129 15:20]:
> > * Dominic Hargreaves ( [120128 23:09]:
> > <>

> On Sat, Jan 28, 2012 at 03:34:49PM -0800, Mark Overmeer via RT wrote:
> > You like to enlarge the default for MAXPATHLEN to an other artificial
> > value, where also a known PATH_MAX is probably too small.  So, why not
> > remove the attempt to get a realistic value from the OS here?
> >    #define ALWAYS_LARGE_ENOUGH  32768
> >    Char *bufnext, *bufend, patbuf[ALWAYS_LARGE_ENOUGH];
> >    bufend = bufnext + ALWAYS_LARGE_ENOUGH - 1;
> As I understand it, you're suggesting picking a different arbitrary value
> as a maximum, and using it even when the underlying system wouldn't 
> support paths that long. I'm not convinced that this is an improvement
> on my suggestion. Have I missed something?

The document you pointed us to, and documents referred to in that doc,
suggest that PATH_MAX/MAXPATHLEN are constants much shorter than
the actual maximum size of the path. So, why should the buffer used
in bsd_glob.c be smaller than may be needed?  In lack of any useful
constant with a realistic value, we can just pick something huge (in
this context)

       Mark Overmeer MSc                                MARKOV Solutions                         

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About