diff options
author | Nick Clifton <nickc@redhat.com> | 2002-01-17 16:39:53 +0000 |
---|---|---|
committer | Nick Clifton <nickc@redhat.com> | 2002-01-17 16:39:53 +0000 |
commit | b2db0ebcfe5ade4a1db755bca5112400a69be288 (patch) | |
tree | a4fe0a94bbf2ba68331117f6089e65e1276c281d /newlib | |
parent | 104c3be68177cc1f239d42bdfcc66f2bf5789942 (diff) | |
download | newlib-b2db0ebcfe5ade4a1db755bca5112400a69be288.zip newlib-b2db0ebcfe5ade4a1db755bca5112400a69be288.tar.gz newlib-b2db0ebcfe5ade4a1db755bca5112400a69be288.tar.bz2 |
_sbrk(): Return -1 rather than aborting if too much memory is requested.
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 5 | ||||
-rw-r--r-- | newlib/libc/sys/arm/syscalls.c | 12 |
2 files changed, 15 insertions, 2 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index c4ad7cc..7972245 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +2002-01-17 Nick Clifton <nickc@cambridge.redhat.com> + + * libc/sys/arm/syscalls.c (_sbrk): Return -1 rather than aborting + if too much memory is requested. + 2002-01-11 Jeff Johnston <jjohnstn@redhat.com> * libc/stdio/vfscanf.c (__svfscanf_r): Change loop that diff --git a/newlib/libc/sys/arm/syscalls.c b/newlib/libc/sys/arm/syscalls.c index 795f778..0483d48 100644 --- a/newlib/libc/sys/arm/syscalls.c +++ b/newlib/libc/sys/arm/syscalls.c @@ -470,8 +470,6 @@ _getpid (int n) n = n; } -extern void abort (void); - caddr_t _sbrk (int incr) { @@ -486,8 +484,18 @@ _sbrk (int incr) if (heap_end + incr > stack_ptr) { + /* Some of the libstdc++-v3 tests rely upon detecting + out of memory errors, so do not abort here. */ +#if 0 + extern void abort (void); + _write (1, "_sbrk: Heap and stack collision\n", 32); + abort (); +#else + errno = ENOMEM; + return -1; +#endif } heap_end += incr; |