[vorbis-dev] ogg123/getopt/NAME_MAX

Jeff Squyres jsquyres at lsc.nd.edu
Thu Jan 25 18:16:36 PST 2001

1. ogg123 still won't build systems that don't have <getopt.h>.  Was
anything ever decided on how to procede with that?  oggenc supplies its
own getopt implementation.  The only function really in question is
getopt_long(), because getopt() is standard POSIX.  See
http://www.xiph.org/archives/vorbis-dev/200012/0359.html for a discussion
of this issue.

2. Also, NAME_MAX is used in ogg123/ao_interface.c -- this constant is not
portable (doesn't exist in Solaris, for example).  pathconf() should
really be used instead.

POSIX 1003.1a, section 2.9.5, table 2-5 contains [NAME_MAX] and the
related text states:

A definition of one of the values from Table 2-5 shall be omitted from the
<limits.h> on specific implementations where the corresponding value is
equal to or greater than the stated minimum, but where the value can vary
depending on the file to which it is applied. The actual value supported
for a specific pathname shall be provided by the pathconf() (5.7.1)

No, I won't take credit/blame for looking that up -- it was in Solaris'
<limits.h> :-)  Hence, Solaris doesn't define NAME_MAX, because different
filesystems have different values.  pathconf() will return the max for a
given filesystem:

        filename = (char*) malloc(pathconf(homedir, _PC_PATH_MAX));

{+} Jeff Squyres
{+} squyres at cse.nd.edu
{+} Perpetual Obsessive Notre Dame Student Craving Utter Madness
{+} "I came to ND for 4 years and ended up staying for a decade"

--- >8 ----
List archives:  http://www.xiph.org/archives/
Ogg project homepage: http://www.xiph.org/ogg/
To unsubscribe from this list, send a message to 'vorbis-dev-request at xiph.org'
containing only the word 'unsubscribe' in the body.  No subject is needed.
Unsubscribe messages sent to the list will be ignored/filtered.

More information about the Vorbis-dev mailing list