mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:07:45 +00:00
LibC: Implement enough missing stuff to get bash-5.0 running. :^)
This commit is contained in:
parent
5158bee08c
commit
736e852525
26 changed files with 125 additions and 37 deletions
|
@ -6,6 +6,7 @@
|
|||
#include <grp.h>
|
||||
#include <pwd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <sys/types.h>
|
||||
#include <Kernel/Syscall.h>
|
||||
|
@ -186,6 +187,10 @@ int chdir(const char* path)
|
|||
|
||||
char* getcwd(char* buffer, size_t size)
|
||||
{
|
||||
if (!buffer) {
|
||||
size = size ? size : PATH_MAX;
|
||||
buffer = (char*)malloc(size);
|
||||
}
|
||||
int rc = syscall(SC_getcwd, buffer, size);
|
||||
__RETURN_WITH_ERRNO(rc, buffer, nullptr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue