This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Mismatch between NAME_MAX and MAXNAMLEN
- From: Gedare Bloom <gedare at rtems dot org>
- To: "newlib at sourceware dot org" <newlib at sourceware dot org>
- Date: Tue, 24 Feb 2015 11:38:00 -0500
- Subject: Mismatch between NAME_MAX and MAXNAMLEN
- Authentication-results: sourceware.org; auth=none
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 NAME_MAX
#else
#define MAXNAMLEN 1024
#endif
Or define MAXNAMLEN in RTEMS specific limits.h or syslimits.h headers.
But probably this mismatch can affect others.
What is preferred?
Gedare
[1] https://devel.rtems.org/ticket/1394
[2] http://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html