Kernel/LibC: add SYS_STAT and stat(), lstat()
This commit is contained in:
14
libc/sys/stat.cpp
Normal file
14
libc/sys/stat.cpp
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user