diff --git a/LibC/limits.h b/LibC/limits.h index e69de29bb2..355cea6330 100644 --- a/LibC/limits.h +++ b/LibC/limits.h @@ -0,0 +1,3 @@ +#pragma once + +#define PATH_MAX 4096 diff --git a/LibC/sys/param.h b/LibC/sys/param.h index bbc4517380..fa80d611fb 100644 --- a/LibC/sys/param.h +++ b/LibC/sys/param.h @@ -1,4 +1,4 @@ #pragma once #include - +#include diff --git a/LibC/unistd.cpp b/LibC/unistd.cpp index 5ba180d38d..1a5d8b0e95 100644 --- a/LibC/unistd.cpp +++ b/LibC/unistd.cpp @@ -156,6 +156,11 @@ char* getcwd(char* buffer, size_t size) __RETURN_WITH_ERRNO(rc, buffer, nullptr); } +char* getwd(char* buf) +{ + return getcwd(buf, PATH_MAX); +} + int sleep(unsigned seconds) { return Syscall::invoke(Syscall::SC_sleep, (dword)seconds); diff --git a/LibC/unistd.h b/LibC/unistd.h index 69d9e9c31c..d16663140c 100644 --- a/LibC/unistd.h +++ b/LibC/unistd.h @@ -2,6 +2,7 @@ #include #include +#include __BEGIN_DECLS @@ -29,6 +30,7 @@ int close(int fd); pid_t waitpid(pid_t, int* wstatus, int options); int chdir(const char* path); char* getcwd(char* buffer, size_t size); +char* getwd(char* buffer); int lstat(const char* path, struct stat* statbuf); int stat(const char* path, struct stat* statbuf); int sleep(unsigned seconds);