projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
remove objcopy --weaken from the makefile
[musl]
/
src
/
linux
/
sbrk.c
diff --git
a/src/linux/sbrk.c
b/src/linux/sbrk.c
index
56f60d1
..
3643765
100644
(file)
--- a/
src/linux/sbrk.c
+++ b/
src/linux/sbrk.c
@@
-1,7
+1,9
@@
-#include <std
def
.h>
+#include <std
int
.h>
#include "syscall.h"
#include "syscall.h"
-void *sbrk(
ptrdiff
_t inc)
+void *sbrk(
intptr
_t inc)
{
{
- return (void *)syscall1(__NR_brk, syscall1(__NR_brk, 0)+inc);
+ unsigned long cur = syscall(SYS_brk, 0);
+ if (inc && syscall(SYS_brk, cur+inc) != cur+inc) return (void *)-1;
+ return (void *)cur;
}
}