summaryrefslogtreecommitdiffstats
path: root/cpukit/sapi/include/confdefs.h
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/sapi/include/confdefs.h')
-rw-r--r--cpukit/sapi/include/confdefs.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/cpukit/sapi/include/confdefs.h b/cpukit/sapi/include/confdefs.h
index bf9f5e8d6f..1585548e7c 100644
--- a/cpukit/sapi/include/confdefs.h
+++ b/cpukit/sapi/include/confdefs.h
@@ -61,6 +61,10 @@
#include <bsp.h>
#endif
+#ifdef RTEMS_NEWLIB
+ #include <sys/reent.h>
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -1650,6 +1654,16 @@ const rtems_libio_helper rtems_fs_init_helper =
#define CONFIGURE_NUMBER_OF_INITIAL_EXTENSIONS 0
#endif
+#if defined(RTEMS_NEWLIB) && defined(__DYNAMIC_REENT__)
+ struct _reent *__getreent(void)
+ {
+ #ifdef CONFIGURE_DISABLE_NEWLIB_REENTRANCY
+ return _GLOBAL_REENT;
+ #else
+ return _Thread_Get_executing()->libc_reent;
+ #endif
+ }
+#endif
#endif
@@ -1939,8 +1953,6 @@ const rtems_libio_helper rtems_fs_init_helper =
*/
#if (defined(RTEMS_NEWLIB) && !defined(CONFIGURE_DISABLE_NEWLIB_REENTRANCY))
- #include <reent.h>
-
#define CONFIGURE_MEMORY_PER_TASK_FOR_NEWLIB \
_Configure_From_workspace(sizeof(struct _reent))
#else