Skip to content

Commit

Permalink
LibC: Stub out brk and sbrk
Browse files Browse the repository at this point in the history
  • Loading branch information
timschumi authored and awesomekling committed Jun 30, 2022
1 parent e2036ca commit 9497cc6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Userland/Libraries/LibC/unistd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
2 changes: 2 additions & 0 deletions Userland/Libraries/LibC/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 9497cc6

Please sign in to comment.