mescc: getcwd: Move to libc.

* lib/linux/libc.c (getcwd): New function.
* lib/linux/tcc.c (getcwd): Remove.
This commit is contained in:
Jan Nieuwenhuizen 2018-11-11 10:12:19 +01:00
parent 68441476e0
commit 6e2f941573
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
2 changed files with 9 additions and 6 deletions

View File

@ -150,6 +150,15 @@ fsync (int filedes)
return _sys_call1 (SYS_fsync, (int)filedes);
}
char *
getcwd (char *buffer, size_t size)
{
int r = _sys_call2 (SYS_getcwd, (long)buffer, (long)size);
if (r >= 0)
return buffer;
return 0;
}
#include "linux/clock_gettime.c"
#include "linux/gettimeofday.c"
#include "linux/time.c"

View File

@ -54,9 +54,3 @@ stat (char const *file_name, struct stat *statbuf)
{
return _sys_call2 (SYS_stat, (long)file_name, (long)statbuf);
}
char *
getcwd (char *buffer, size_t size)
{
return _sys_call2 (SYS_getcwd, (long)buffer, (long)size);
}