Kernel/LibC: add SYS_STAT and stat(), lstat()

This commit is contained in:
Bananymous
2023-06-05 14:36:17 +03:00
parent 69b94dad00
commit d1ad38c8d4
10 changed files with 75 additions and 9 deletions

14
libc/sys/stat.cpp Normal file
View File

@@ -0,0 +1,14 @@
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/syscall.h>
#include <unistd.h>
int lstat(const char* __restrict path, struct stat* __restrict buf)
{
return syscall(SYS_STAT, path, buf, O_RDONLY | O_NOFOLLOW);
}
int stat(const char* __restrict path, struct stat* __restrict buf)
{
return syscall(SYS_STAT, path, buf, O_RDONLY);
}