[Bug 1394] scandir() fails due to MAXNAMELEN is incorrect

bugzilla-daemon at rtems.org bugzilla-daemon at rtems.org
Thu Mar 28 10:30:17 UTC 2013


https://www.rtems.org/bugzilla/show_bug.cgi?id=1394

Sebastian Huber <sebastian.huber at embedded-brains.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.11

--- Comment #4 from Sebastian Huber <sebastian.huber at embedded-brains.de> 2013-03-28 05:30:17 CDT ---
I just looked in the latest Newlib sources.  The MAXNAMELEN vs. NAME_MAX
problem still exists:

./newlib/libc/sys/rtems/sys/syslimits.h:#define NAME_MAX                  255  
/* max bytes in a file name */
./newlib/libc/sys/rtems/sys/dirent.h:   char            d_name[NAME_MAX + 1];

./newlib/libc/include/dirent.h:#if !defined(MAXNAMLEN) &&
!defined(_POSIX_SOURCE)
./newlib/libc/include/dirent.h:#define MAXNAMLEN 1024

0x0202acd0 in scandir (dirname=<optimized out>, namelist=0x203feb0,
select=0x200149c <select1>, dcomp=0x0) at
/home/sh/archive/gcc-4.6.3/newlib/libc/posix/scandir.c:117
117                     p = (struct dirent *)malloc(DIRSIZ(d));
Value returned is $1 = 1
(gdb) s
malloc (size=4294966555) at
/home/sh/git-rtems/c/src/../../cpukit/libcsupport/src/malloc.c:33
33        MSBUMP(malloc_calls, 1);

The psxtests/psxreaddir is quite sloppy since the scandir() return status is
only printed:

scandir status: -1

-- 
Configure bugmail: https://www.rtems.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the bugs mailing list