forked from Bananymous/banan-os
Kernel/LibC: add SYS_STAT and stat(), lstat()
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
@@ -145,6 +146,14 @@ long syscall(long syscall, ...)
|
||||
ret = Kernel::syscall(SYS_WAIT, pid, (uintptr_t)stat_loc, options);
|
||||
break;
|
||||
}
|
||||
case SYS_STAT:
|
||||
{
|
||||
const char* path = va_arg(args, const char*);
|
||||
struct stat* buf = va_arg(args, struct stat*);
|
||||
int flags = va_arg(args, int);
|
||||
ret = Kernel::syscall(SYS_STAT, (uintptr_t)path, (uintptr_t)buf, flags);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
puts("LibC: Unhandeled syscall");
|
||||
ret = -ENOSYS;
|
||||
|
||||
Reference in New Issue
Block a user