This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
scandir issue on RTEMS
- From: Joel Sherrill <joel dot sherrill at oarcorp dot com>
- To: "newlib at sources dot redhat dot com" <newlib at sources dot redhat dot com>
- Date: Thu, 19 Mar 2009 11:07:17 -0500
- Subject: scandir issue on RTEMS
Hi,
I got this report from a user and wondered if someone
could provide a recommendation. I am getting wrapped
around the axle trying to figure out what should be
set by whom where.
It is used in scandir() (newlib-1.17.0/newlib/libc/posix/scandir.c:117)
by the macro DIRSIZ. Where DIRSIZ uses the MAXNAMELEN define which is
set incorrectly. It does not match the sizeof(struct dirent) which makes
the DIRSIZ return a negative number, then malloc(DIRSIZ(d)) will try to
allocate 4GB which fail.
My guess is that MAXNAMELEN should be defined in
newlib-1.17.0/newlib/libc/sys/rtems/sys/dirent.h or
newlib-1.17.0/newlib/libc/sys/rtems/include/limits.h or in a new file.
--
Joel Sherrill, Ph.D. Director of Research & Development
joel.sherrill@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985