Another system include file issue (stat.h)

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
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:


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__"
#    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.