Mismatch between NAME_MAX and MAXNAMLEN

Gedare Bloom gedare@rtems.org
Tue Feb 24 18:18:00 GMT 2015

RTEMS users observe a problem with scandir() arising from difference
between NAME_MAX and MAXNAMLEN. MAXNAMLEN is defined in
libc/include/dirent.h. Our user's bug report is here [1].

MAXNAMLEN probably should agree with NAME_MAX according to [2].

We could change libc/include/dirent.h by adding:
#if defined(NAME_MAX)
#define MAXNAMLEN 1024

Or define MAXNAMLEN in RTEMS specific limits.h or syslimits.h headers.
But probably this mismatch can affect others.

What is preferred?


[1] https://devel.rtems.org/ticket/1394
[2] http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html

More information about the Newlib mailing list