summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2022-06-29 05:00:28 +0200
committerAndreas Kling <kling@serenityos.org>2022-06-30 11:57:49 +0200
commit9497cc6c97afaad1749e8eccdf218d0c903349c5 (patch)
tree99e544e4cd3825fb08b2fa4513d5f9fb0787ba6a
parente2036ca2caae571ee63a613742cdb9c68d79d6d9 (diff)
downloadserenity-9497cc6c97afaad1749e8eccdf218d0c903349c5.zip
LibC: Stub out `brk` and `sbrk`
-rw-r--r--Userland/Libraries/LibC/unistd.cpp14
-rw-r--r--Userland/Libraries/LibC/unistd.h2
2 files changed, 16 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/unistd.cpp b/Userland/Libraries/LibC/unistd.cpp
index 77420a3e61..b305185249 100644
--- a/Userland/Libraries/LibC/unistd.cpp
+++ b/Userland/Libraries/LibC/unistd.cpp
@@ -1002,4 +1002,18 @@ int nice(int incr)
dbgln("FIXME: nice was called with: {}, not implemented", incr);
return incr;
}
+
+int brk(void* addr)
+{
+ dbgln("TODO: brk({:#x})", addr);
+ errno = ENOMEM;
+ return -1;
+}
+
+void* sbrk(intptr_t incr)
+{
+ dbgln("TODO: sbrk({:#x})", incr);
+ errno = ENOMEM;
+ return reinterpret_cast<void*>(-1);
+}
}
diff --git a/Userland/Libraries/LibC/unistd.h b/Userland/Libraries/LibC/unistd.h
index 6707a5bbab..cf3c2896fd 100644
--- a/Userland/Libraries/LibC/unistd.h
+++ b/Userland/Libraries/LibC/unistd.h
@@ -121,6 +121,8 @@ int pause(void);
int chroot(char const*);
int getdtablesize(void);
int nice(int incr);
+int brk(void* addr);
+void* sbrk(intptr_t incr);
enum {
_PC_NAME_MAX,