New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Increase the fallback value of MAXPATHLEN #11915
Comments
From @jmdhThe attached patch addresses a problem reported as Increasing this to 4096 creates parity between GNU/Hurd and Thanks, -- |
From @jmdh0001-Increase-the-fallback-value-of-MAXPATHLEN.patchFrom cebdc646ef3126f43ae87d56da6d504fa80e4088 Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves <dom@earth.li>
Date: Sat, 28 Jan 2012 14:00:39 +0000
Subject: [PATCH] Increase the fallback value of MAXPATHLEN
On systems without MAXPATHLEN or PATH_MAX defined (GNU/Hurd is an example
of such a system), set MAXPATHLEN to 4096 rather than 1024; this increase
creates parity with Linux.
---
ext/File-Glob/bsd_glob.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ext/File-Glob/bsd_glob.c b/ext/File-Glob/bsd_glob.c
index 5019af1..1e9ead3 100644
--- a/ext/File-Glob/bsd_glob.c
+++ b/ext/File-Glob/bsd_glob.c
@@ -83,7 +83,7 @@ static char sscsid[]= "$OpenBSD: glob.c,v 1.8.10.1 2001/04/10 jason Exp $";
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
# else
-# define MAXPATHLEN 1024
+# define MAXPATHLEN 4096
# endif
#endif
--
1.7.7.3
|
From @cpansproutOn Sat Jan 28 06:22:08 2012, dom wrote:
I’m not an expert in this area (in fact, I’m not an expert in any OS -- Father Chrysostomos |
The RT System itself - Status changed from 'new' to 'open' |
From @LeontOn Sat, Jan 28, 2012 at 9:22 PM, Father Chrysostomos via RT
In POSIX, system calls taking a path should return a ENAMETOOLONG Leon |
From Mark@Overmeer.net* Dominic Hargreaves (perlbug-followup@perl.org) [120128 14:22]:
The C constant _POSIX_PATH_MAX gives the minimal value for PATH_MAX to MarkOv Mark Overmeer MSc MARKOV Solutions |
From @jmdhOn Sat, Jan 28, 2012 at 02:42:17PM -0800, Mark Overmeer via RT wrote:
No, on GNU/Hurd 'POSIX::pathconf( "/etc", &POSIX::_PC_PATH_MAX )' There is some more about this issue generally at <http://www.gnu.org/software/hurd/community/gsoc/project_ideas/maxpath.html> -- |
From Mark@Overmeer.net* Dominic Hargreaves (dom@earth.li) [120128 23:09]:
Not only PATH_MAX, but also many other global constants do not really You like to enlarge the default for MAXPATHLEN to an other artificial #define ALWAYS_LARGE_ENOUGH 32768 -- drs Mark A.C.J. Overmeer MARKOV Solutions |
From @jmdhOn Sat, Jan 28, 2012 at 03:34:49PM -0800, Mark Overmeer via RT wrote:
As I understand it, you're suggesting picking a different arbitrary value Cheers, -- |
From Mark@Overmeer.net* Dominic Hargreaves (dom@earth.li) [120129 15:20]:
The document you pointed us to, and documents referred to in that doc, Mark Overmeer MSc MARKOV Solutions |
From @jmdhOn Sun, Jan 29, 2012 at 09:01:35AM -0800, Mark Overmeer via RT wrote:
Right, I see that you're referring to My choice of 4096 was a trade off based on what people seem to expect In an ideal world, there wouldn't be a fixed size buffer here at all, -- |
From solutions@overmeer.net* Dominic Hargreaves (dom@earth.li) [120129 18:55]:
It's not "in Perl", but only "in glob" (at least the bug report) Mark Overmeer MSc MARKOV Solutions |
From @jmdhOn Sun, Jan 29, 2012 at 12:39:39PM -0800, Mark Overmeer via RT wrote:
That's pretty much my point. Increasing the fallback value is a quick -- |
From @cpansproutOn Mon Jan 30 14:44:05 2012, dom wrote:
I think that’s a good enough argument for this small change. I’ve -- Father Chrysostomos |
@cpansprout - Status changed from 'open' to 'resolved' |
From @jmdhOn Mon, Jan 30, 2012 at 04:01:57PM -0800, Father Chrysostomos via RT wrote:
Unfortunately, and rather embarrassingly, I only just[1] received the It's likely, therefore, that another commit will be needed, once we've Dominic. [1] Debian infrastructure problems -- |
@jmdh - Status changed from 'resolved' to 'open' |
From @jmdhOn Tue, Jan 31, 2012 at 09:55:38AM +0000, Dominic Hargreaves wrote:
Okay, so perl.h has its own fallback definition of MAXPATHLEN, which, Therefore, my new proposed fix is attached, along with a reversion I actually have a commit bit now, so if I can get positive feedback I've now actually verified this against a test case, also attached; any Thanks, [1] <http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=656869> -- |
From @jmdh0001-Don-t-use-_POSIX_PATH_MAX-as-a-fallback-PATH_MAX.patchFrom 27f1ced91c044ec133b3def3bef964bbd52706f6 Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves <dom@earth.li>
Date: Fri, 3 Feb 2012 19:35:36 +0000
Subject: [PATCH 1/2] Don't use _POSIX_PATH_MAX as a fallback PATH_MAX
_POSIX_PATH_MAX is required to be defined for POSIX systems as
256, which is too small for a fallback PATH_MAX (some systems, such as
GNU/Hurd, do not have an inherent limit on path length).
---
perl.h | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/perl.h b/perl.h
index fe1eaec..3448a2b 100644
--- a/perl.h
+++ b/perl.h
@@ -2764,11 +2764,7 @@ freeing any remaining Perl interpreters.
# define MAXPATHLEN (PATH_MAX+1)
# endif
# else
-# ifdef _POSIX_PATH_MAX
-# define MAXPATHLEN _POSIX_PATH_MAX
-# else
-# define MAXPATHLEN 1024 /* Err on the large side. */
-# endif
+# define MAXPATHLEN 1024 /* Err on the large side. */
# endif
#endif
--
1.7.8.3
|
From @jmdh0002-Revert-Increase-the-fallback-value-of-MAXPATHLEN.patchFrom 9973f328375f257eb400846f7bd00ed5e687b7ad Mon Sep 17 00:00:00 2001
From: Dominic Hargreaves <dom@earth.li>
Date: Fri, 3 Feb 2012 19:40:30 +0000
Subject: [PATCH 2/2] Revert "Increase the fallback value of MAXPATHLEN"
This reverts commit ffa23acf6bf9670bd1d5fdc9a958c918b6cf3d06.
This change was made without realisation that the fallback value for
MAXPATHLEN on POSIX systems comes (in perl.h) from _POSIX_MAX_PATH,
so the fallback value here was not used.
---
ext/File-Glob/bsd_glob.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/ext/File-Glob/bsd_glob.c b/ext/File-Glob/bsd_glob.c
index 1e9ead3..5019af1 100644
--- a/ext/File-Glob/bsd_glob.c
+++ b/ext/File-Glob/bsd_glob.c
@@ -83,7 +83,7 @@ static char sscsid[]= "$OpenBSD: glob.c,v 1.8.10.1 2001/04/10 jason Exp $";
# ifdef PATH_MAX
# define MAXPATHLEN PATH_MAX
# else
-# define MAXPATHLEN 4096
+# define MAXPATHLEN 1024
# endif
#endif
--
1.7.8.3
|
From @rjbsThanks Dominic, please go ahead. |
From @jmdhCommitted to blead. |
From [Unknown Contact. See original ticket]Committed to blead. |
@jmdh - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#109262 (status was 'resolved')
Searchable as RT109262$
The text was updated successfully, but these errors were encountered: