BuildSystem: Move all userpace libraries under the userspace directory

As the number of libraries is increasing, root directory starts to
expand. This adds better organization for libraries
This commit is contained in:
2024-06-18 13:14:35 +03:00
parent 1b5a01a6c9
commit c69919738b
157 changed files with 46 additions and 30 deletions

View File

@@ -0,0 +1,40 @@
#include <fcntl.h>
#include <errno.h>
#include <stdarg.h>
#include <sys/syscall.h>
#include <unistd.h>
int creat(const char* path, mode_t mode)
{
return syscall(SYS_CREATE, path, S_IFREG | mode);
}
int open(const char* path, int oflag, ...)
{
va_list args;
va_start(args, oflag);
mode_t mode = va_arg(args, mode_t);
va_end(args);
return syscall(SYS_OPEN, path, oflag, mode);
}
int openat(int fd, const char* path, int oflag, ...)
{
va_list args;
va_start(args, oflag);
mode_t mode = va_arg(args, mode_t);
va_end(args);
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);
}