Changeset fe09d8d in rtems


Ignore:
Timestamp:
Feb 14, 2020, 4:16:46 AM (4 months ago)
Author:
Chris Johns <chrisj@…>
Branches:
4.11
Children:
4d906d6a
Parents:
33c82dd
git-author:
Chris Johns <chrisj@…> (02/14/20 04:16:46)
git-committer:
Chris Johns <chrisj@…> (02/19/20 08:01:08)
Message:

libcsupport/newlib: Call newlib's sinit to force reent initialisation

  • Newlib overtites any FILE pointers set in stdin, stdout or stderr.

Closes #3870

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/src/newlibc_reent.c

    r33c82dd rfe09d8d  
    4545#endif
    4646
    47   _REENT_INIT_PTR((creating_task->libc_reent)); /* GCC extension: structure constants */
     47  extern void __sinit (struct _reent *s);
     48  struct _reent *reent = (struct _reent *) creating_task->libc_reent;
     49  _REENT_INIT_PTR((reent)); /* GCC extension: structure constants */
     50  __sinit( reent );
    4851
    4952  return true;
  • testsuites/libtests/newlib01/init.c

    r33c82dd rfe09d8d  
    246246  rtems_resource_snapshot snapshot;
    247247
     248  rtems_test_assert(fileno(stdout) >= 0);
     249  rtems_test_assert(fileno(stdin) >= 0);
     250  rtems_test_assert(fileno(stderr) >= 0);
     251
    248252  ctx->main_task_id = rtems_task_self();
    249253
     
    276280  rtems_test_assert(sc == RTEMS_SUCCESSFUL);
    277281
     282  rtems_test_assert(fileno(stdout) >= 0);
     283  rtems_test_assert(fileno(stdin) >= 0);
     284  rtems_test_assert(fileno(stderr) >= 0);
     285
    278286  rv = unlink(&file_path[0]);
    279287  rtems_test_assert(rv == 0);
Note: See TracChangeset for help on using the changeset viewer.