source: rtems/cpukit/libcsupport/src/newlibc_reent.c @ 1c6926c1

5
Last change on this file since 1c6926c1 was ac5f2442, checked in by Sebastian Huber <sebastian.huber@…>, on 11/25/15 at 07:33:31

Require getreent()

This function is used by Newlib since 2013-07-09 (Git commit
9b51cd8c6b9cdd067d9648a7ab952884019c56a5).

  • Property mode set to 100644
File size: 868 bytes
Line 
1/**
2 *  @file
3 *
4 *  @brief Newlib Support
5 *  @ingroup libcsupport
6 */
7
8/*
9 *  COPYRIGHT (c) 1994 by Division Incorporated
10 *
11 *  The license and distribution terms for this file may be
12 *  found in the file LICENSE in this distribution or at
13 *  http://www.rtems.org/license/LICENSE.
14 *
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems.h>
22
23#if defined(RTEMS_NEWLIB)
24
25#include <sys/reent.h>
26#include <stdlib.h>
27#include <string.h>
28
29#include <rtems/libcsupport.h>
30#include <rtems/score/threadimpl.h>
31#include <rtems/score/wkspace.h>
32
33bool newlib_create_hook(
34  rtems_tcb *current_task RTEMS_UNUSED,
35  rtems_tcb *creating_task
36)
37{
38  _REENT_INIT_PTR((creating_task->libc_reent)); /* GCC extension: structure constants */
39
40  return true;
41}
42
43void newlib_terminate_hook(
44  rtems_tcb *current_task
45)
46{
47  _reclaim_reent(current_task->libc_reent);
48}
49
50#endif
Note: See TracBrowser for help on using the repository browser.