Bug in getcwd()

Joel Sherrill joel.sherrill at oarcorp.com
Wed Oct 1 18:10:58 UTC 2014


On 10/1/2014 9:26 AM, Rohner Thomas wrote:
>
> Hello,
>
>  
>
> maybe I found a bug in getcwd().
>
>  
>
> We’re using RTEMS 4.0 with Gaisler-Aeroflex….
>
> With our libraries I get an erroneous string when directory-depth is
> about 4 folders from root!
>
> When I use this string to read directory it crahes!
>
>  
>
>  
>
> Is there a limitation of string-length?
>
> I get the same results for
>
>  
>
>                Char buffer[200];
>
> getcwd(buffer,sizeof(buffer));
>
>  
>
> or
>
>  
>
>                char* ret = getcwd(NULL,0);
>
>  
>
>  
>
Is this with the IMFS? What BSP?

Can you put together a full test example so we can
see what is really happening?

There is a POSIX constant for PATH_MAX as I recall but
it is quite large.
>
>  
>
>  
>
> Freundliche Grüsse / Kind regards,
>
> 	
>
> image001
>
>  
>
> *Thomas Rohner***
>
> Entwicklungsingenieur Software
>
>  
>
> nanoTRONIC GmbH
>
> Werkstrasse 27, CH - 3250 Lyss 
>
>  
>
> 	
>
>  
>
> T: +41 32 384 69 30, F: +41 32 384 69 31
>
> www.nanotronic.ch <http://www.nanotronic.ch/> |
> thomas.rohner at nanotronic.ch <mailto:thomas.rohner at nanotronic.ch>
>
>  
>
>  
>
>  
>
>  
>
>  
>
>  
>

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill at OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20141001/fe6de927/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 4023 bytes
Desc: not available
URL: <http://lists.rtems.org/pipermail/users/attachments/20141001/fe6de927/attachment-0002.jpe>


More information about the users mailing list