1 /* Reentrant version of sbrk system call. */
7 /* Some targets provides their own versions of these functions. Those
8 targets should define REENTRANT_SYSCALLS_PROVIDED in TARGET_CFLAGS. */
11 #ifndef REENTRANT_SYSCALLS_PROVIDED
12 #define REENTRANT_SYSCALLS_PROVIDED
16 #if defined (REENTRANT_SYSCALLS_PROVIDED)
18 int _dummy_sbrk_syscalls
= 1;
22 /* We use the errno variable used by the system dependent layer. */
28 <<_sbrk_r>>---Reentrant version of sbrk
35 void *_sbrk_r(struct _reent *<[ptr]>, ptrdiff_t <[incr]>);
38 This is a reentrant version of <<sbrk>>. It
39 takes a pointer to the global data block, which holds
44 _sbrk_r (struct _reent
*ptr
,
48 void *_sbrk(ptrdiff_t);
51 if ((ret
= (char *)(_sbrk (incr
))) == (void *) -1 && errno
!= 0)
52 _REENT_ERRNO(ptr
) = errno
;
56 #endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */