diff --git a/lib/linux/libc.c b/lib/linux/libc.c index da7383e7..6d990c27 100644 --- a/lib/linux/libc.c +++ b/lib/linux/libc.c @@ -21,6 +21,7 @@ #include #include +#include #include #include #include @@ -151,7 +152,7 @@ fsync (int filedes) } char * -getcwd (char *buffer, size_t size) +_getcwd (char *buffer, size_t size) { int r = _sys_call2 (SYS_getcwd, (long)buffer, (long)size); if (r >= 0) @@ -159,6 +160,15 @@ getcwd (char *buffer, size_t size) return 0; } +char * +getcwd (char *buffer, size_t size) +{ + static char buf[PATH_MAX]; + if (buffer) + return _getcwd (buffer, size); + return _getcwd (buf, PATH_MAX); +} + int dup (int old) {