Heny Townsend
2005-01-29 00:17:44 UTC
I notice that PATH_MAX on Solaris is at (2**n - 1):
% getconf -a | grep PATH_MAX
PATH_MAX: 1023
_POSIX_PATH_MAX: 255
Whereas on Linux and FreeBSD it's the full round number (256/1024 on
FreeBSD, 256/4096 on Linux). Did somebody read POSIX wrong? Or is it a
case where POSIX is unclear and Sun decided to be pessimistic while the
freebies were optimistic? Or maybe Solaris is counting on the fact that
a request for 1023 bytes will generally be padded to 1024, thus allowing
a "hidden" spot for the null byte and avoiding programmer off-by-one errors?
Notice that it's not just the interpretation of PATH_MAX that differs.
They disagree on the interpretation of _POSIX_PATH_MAX too.
% getconf -a | grep PATH_MAX
PATH_MAX: 1023
_POSIX_PATH_MAX: 255
Whereas on Linux and FreeBSD it's the full round number (256/1024 on
FreeBSD, 256/4096 on Linux). Did somebody read POSIX wrong? Or is it a
case where POSIX is unclear and Sun decided to be pessimistic while the
freebies were optimistic? Or maybe Solaris is counting on the fact that
a request for 1023 bytes will generally be padded to 1024, thus allowing
a "hidden" spot for the null byte and avoiding programmer off-by-one errors?
Notice that it's not just the interpretation of PATH_MAX that differs.
They disagree on the interpretation of _POSIX_PATH_MAX too.
--
Henry Townsend
Henry Townsend