summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-01 16:30:18 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2018-02-01 16:30:18 -0600
commitc9f8eb168eaecd267e86bafc598a0c1155304b90 (patch)
tree24ba3ec24551c75a87082fedfbf5f6defad35e9e
parent22deb7d22c439640c6acee48f2f87f4f8cb460bc (diff)
downloadgcompat-c9f8eb168eaecd267e86bafc598a0c1155304b90.tar.gz
gcompat-c9f8eb168eaecd267e86bafc598a0c1155304b90.tar.bz2
gcompat-c9f8eb168eaecd267e86bafc598a0c1155304b90.tar.xz
gcompat-c9f8eb168eaecd267e86bafc598a0c1155304b90.zip
malloc: add __sbrk
-rw-r--r--CHANGELOG.rst6
-rw-r--r--libgcompat/malloc.c6
2 files changed, 12 insertions, 0 deletions
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 8ab6f2f..a35657e 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -19,6 +19,12 @@ Build system
* Ensure correct compilation on GCC 4.x.
+malloc
+------
+
+* Add __sbrk.
+
+
sysctl
------
diff --git a/libgcompat/malloc.c b/libgcompat/malloc.c
index 14fbf66..e0b5851 100644
--- a/libgcompat/malloc.c
+++ b/libgcompat/malloc.c
@@ -27,6 +27,7 @@
#include <malloc.h> /* memalign */
#include <stdlib.h> /* {m,c,re}alloc, free */
#include <string.h> /* memset */
+#include <unistd.h> /* sbrk */
#include "alias.h" /* alias */
@@ -73,6 +74,11 @@ void *__libc_realloc(void *ptr, size_t size)
}
alias(__libc_realloc, __realloc);
+void *__sbrk(intptr_t increment)
+{
+ return sbrk(increment);
+}
+
struct mallinfo mallinfo(void)
{
struct mallinfo info;