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

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

Thread Previous | Thread Next
From:
Dominic Hargreaves
Date:
February 3, 2012 15:19
Subject:
Re: [perl #109262] Increase the fallback value of MAXPATHLEN
Message ID:
20120203231856.GJ4209@urchin.earth.li
On Tue, Jan 31, 2012 at 09:55:38AM +0000, Dominic Hargreaves wrote:
> On Mon, Jan 30, 2012 at 04:01:57PM -0800, Father Chrysostomos via RT wrote:
> > On Mon Jan 30 14:44:05 2012, dom wrote:
> > > On Sun, Jan 29, 2012 at 12:39:39PM -0800, Mark Overmeer via RT wrote:
> > > > * Dominic Hargreaves (dom@earth.li) [120129 18:55]:
> > > > > PATH_MAX. I'm not sure I want to be the one who enables that in perl,
> > > > > even if it theoretically correct.
> > > > 
> > > > It's not "in Perl", but only "in glob" (at least the bug report)
> > > > Whether (for instance) chown can handle long path or not is an
> > > > other thing.
> > > 
> > > That's pretty much my point. Increasing the fallback value is a quick
> > > win for GNU/Hurd users, without risking breaking other parts of the
> > > system.
> > > 
> > 
> > I think that’s a good enough argument for this small change.  I’ve
> > applied it as ffa23acf6b.  Thank you.
> 
> Unfortunately, and rather embarrassingly, I only just[1] received the
> mail[2] sent on Sunday pointing out that that fix isn't sufficient.
> Mea culpa for not verifying the fix properly :(
> 
> It's likely, therefore, that another commit will be needed, once we've
> figured out what makes sense.

Okay, so perl.h has its own fallback definition of MAXPATHLEN, which,
if PATH_MAX is not defined, uses _POSIX_PATH_MAX. Samuel suggests at
[1] that this is in error; _POSIX_PATH_MAX is defined[2] to be 256,
whilst PATH_MAX is not required to be defined.

Therefore, my new proposed fix is attached, along with a reversion
of the previous patch which you kindly committed.

I actually have a commit bit now, so if I can get positive feedback
on the attached, I'll push that out to blead.

I've now actually verified this against a test case, also attached; any
thoughts about whether this would make sense to add to the test suite?

Thanks,
Dominic.

[1] <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656869>
[2] <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html>

-- 
Dominic Hargreaves | http://www.larted.org.uk/~dom/
PGP key 5178E2A5 from the.earth.li (keyserver,web,email)

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About