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 MALLOC_PROVIDED is defined, we don't need this function. */
18 #if defined (REENTRANT_SYSCALLS_PROVIDED) || defined (MALLOC_PROVIDED)
20 int _dummy_sbrk_syscalls
= 1;
24 /* We use the errno variable used by the system dependent layer. */
30 <<_sbrk_r>>---Reentrant version of sbrk
37 void *_sbrk_r(struct _reent *<[ptr]>, ptrdiff_t <[incr]>);
41 void *_sbrk_r(<[ptr]>, <[incr]>)
42 struct _reent *<[ptr]>;
46 This is a reentrant version of <<sbrk>>. It
47 takes a pointer to the global data block, which holds
52 _DEFUN (_sbrk_r
, (ptr
, incr
),
53 struct _reent
*ptr _AND
57 void *_sbrk(ptrdiff_t);
60 if ((ret
= (char *)(_sbrk (incr
))) == (void *) -1 && errno
!= 0)
65 #endif /* ! defined (REENTRANT_SYSCALLS_PROVIDED) */