Another system include file issue (stat.h)

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Another system include file issue (stat.h)

641 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by robert.palmer on Fri Apr 13 08:56:17 MST 2012
I'm using v4.2.2_275 of LPCXpresso
I'm using FreeRTOS
and I'm using REDLIB

The FreeRTOS syscalls.c file includes stat.h:

#include <sys/stat.h>

The file it finds is in:

C:\nxp\LPCXpresso_4.2.2_275\lpcxpresso\Tools\arm-non-eabi\include\sys

However, this file contains the following:

#if !defined(__CR2_SYS_STAT_H__)
#  define __CR2_SYS_STAT_H__
#  if defined(__REDLIB__)
#    include_next <sys/stat.h>
#  else
#    include <newlib_inc/sys/stat.h>
#    if !defined (__NEWLIB__) && !defined(__LIBRARY_WARNING_MESSAGE__)
#      warning "Either __NEWLIB__ or __REDLIB__ should be defined when using the C library. Defaulting to __NEWLIB__"
#      define __LIBRARY_WARNING_MESSAGE__
#    endif
#  endif
#endif

Notice that with __REDLIB__ defined - which is my case, it does an

#include_next <sys/stat.h>

so it continues searching the path for another stat.h - which does not exist.  Where should this come from?  What can I do to get this working (aside from switching to NEWLIB)

Is there some DETAILED documentation of RedLib - that defines EXACTLY what it does and does not support.  I know it's CodeRed's version of the standard C library, but it is obviously trimmed down in some way or there would be no point of creating a custom version.
0 Kudos
Reply
1 Reply

607 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by whitecoe on Fri Apr 13 12:30:52 MST 2012
stat.h isn't a standard ANSI/ISO C90 header, which is what Redlib provides. The standard C library is as documented in Plauger's book.

A good online reference for the C90 C library IMHO is...
http://www.cplusplus.com/reference/clibrary/

stat.h is a POSIX library header.


HTH!
0 Kudos
Reply