Bug #2373 LSB MySQL Porting Notes: _POSIX_PATH_MAX not defined by LSB
Submitted: 13 Jan 2004 8:03 Modified: 28 Sep 2010 19:27
Reporter: Lenz Grimmer Email Updates:
Status: Duplicate Impact on me:
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:4.0.14,5.1 OS:Linux (Linux)
Assigned to: Assigned Account CPU Architecture:Any

[13 Jan 2004 8:03] Lenz Grimmer
Excerpt from an email from Mats Wichmann with notes of a build of
MySQL 4.0.14 on 
an LSB system:


5. In mysys/my_lib.c, the constant _POSIX_PATH_MAX
is used. This constant is not defined by the LSB.
A reasonable alternative is the use of PATH_MAX,
the use of _POSIX_PATH_MAX is almost certainly
incorrect in any case.  POSIX and the Single UNIX
Specification allow the maximum path length to=20
differ per file type, so the proper approach to
be sure enough buffer space is allocated is to
use pathconf or fpathconf at runtime, and allocate
the buffer dynamically.  Barring that, PATH_MAX
is reasonable: the requirement is that PATH_MAX
or the per-file pathconf value will be /no less
than/ _POSIX_PATH_MAX, but can be greater, and
of course on Linux implementations, PATH_MAX is
4096 while _POSIX_PATH_MAX (think of it as the
"minimum maximum" for the system, not a value that
should be used in application code) is 256, so
it is probable that not enough space is being

How to repeat:
Try to perform a MySQL build on an LSB development platform
[26 Jan 2004 8:34] Sergei Golubchik
moved to a todo: WL#1449
[28 Sep 2010 19:27] Jonathan Perkin
Closing these individual bugs, we have

 - a patch to fix these problems as of a few years ago (bug#29274)
 - a new bug to create ongoing PB2 builds to ensure LSB correctness (bug#57078)

to replace them.