From 4833b38c4e0568a6b3f063c6eaee6ccf655b3312 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 21 Mar 2001 21:47:31 +0000 Subject: 2001-03-21 Egor Duda Allow building internal stubs for non-reentrant syscalls if target provides its own malloc * libc/reent/reent.c (errno): Move definition here. * libc/reent/sbrkr.c: From here. --- newlib/libc/reent/reent.c | 16 +++++++++++++++- newlib/libc/reent/sbrkr.c | 5 ++--- 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'newlib/libc/reent') diff --git a/newlib/libc/reent/reent.c b/newlib/libc/reent/reent.c index 749a5bf6b..f35d95711 100644 --- a/newlib/libc/reent/reent.c +++ b/newlib/libc/reent/reent.c @@ -7,12 +7,26 @@ INDEX DESCRIPTION This module defines the impure data area used by the - non-rentrant functions, such as strtok. + non-reentrant functions, such as strtok. */ #include #include +#ifdef _REENT_ONLY +#ifndef REENTRANT_SYSCALLS_PROVIDED +#define REENTRANT_SYSCALLS_PROVIDED +#endif +#endif + +#ifndef REENTRANT_SYSCALLS_PROVIDED + +/* We use the errno variable used by the system dependent layer. */ +#undef errno +int errno; + +#endif + /* Interim cleanup code */ void diff --git a/newlib/libc/reent/sbrkr.c b/newlib/libc/reent/sbrkr.c index 7f6930ead..31c9de3d5 100644 --- a/newlib/libc/reent/sbrkr.c +++ b/newlib/libc/reent/sbrkr.c @@ -1,5 +1,4 @@ -/* Reentrant versions of sbrk system call. This implementation just - calls the stat system call. */ +/* Reentrant version of sbrk system call. */ #include #include @@ -24,7 +23,7 @@ int _dummy_sbrk_syscalls = 1; /* We use the errno variable used by the system dependent layer. */ #undef errno -int errno; +extern int errno; /* FUNCTION -- cgit v1.2.3