[New-bugs-announce] [issue16442] PATH_MAX vs MAXPATHLEN vs pathconf(..., _PC_PATH_MAX).

Trent Nelson report at bugs.python.org
Thu Nov 8 17:48:46 CET 2012


New submission from Trent Nelson:

Two immediate issues identified whilst trying to build on HP-UX and IRIX:

1.  Our source is wildly inconsistent with regards to using PATH_MAX versus MAXPATHLEN.

2.  The current logic in osdefs.h is insufficient for ensuring one or the other always has a value (complicated by issue 1 above).

Christian alluded to introducing a PY_PATH_MAX define, which I like.  So, my proposal is to fix the logic in osdefs.h so that it works on a wider range of platforms, with the end goal of defining PY_PATH_MAX, then replacing all occurrences of PATH_MAX|MAXPATHLEN in our tree with the new PY_PATH_MAX.

(It's worth mentioning that, technically, we shouldn't be using PATH_MAX or MAXPATHLEN.  We should be using pathconf(..., _PC_PATH_CONF) to determine the maximum length of the underlying filesystem at runtime and dynamically allocating buffers based on that value.

However, that's a huge, non-trivial change.  For another day.)

----------
assignee: trent
components: Build
messages: 175183
nosy: trent
priority: normal
severity: normal
stage: needs patch
status: open
title: PATH_MAX vs MAXPATHLEN vs pathconf(..., _PC_PATH_MAX).
type: compile error
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue16442>
_______________________________________


More information about the New-bugs-announce mailing list