Kernel: add basic fcntl() with couple of commands and no validation

This commit is contained in:
Bananymous
2023-09-04 12:57:09 +03:00
parent a711462ef4
commit 6f002c926a
7 changed files with 50 additions and 0 deletions

View File

@@ -23,3 +23,13 @@ int openat(int fd, const char* path, int oflag, ...)
return syscall(SYS_OPENAT, fd, path, oflag, mode);
}
int fcntl(int fildes, int cmd, ...)
{
va_list args;
va_start(args, cmd);
int extra = va_arg(args, int);
va_end(args);
return syscall(SYS_FCNTL, fildes, cmd, extra);
}

View File

@@ -50,6 +50,7 @@ __BEGIN_DECLS
#define SYS_GET_PID 43
#define SYS_GET_PGID 44
#define SYS_SET_PGID 45
#define SYS_FCNTL 46
__END_DECLS