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:
35
userspace/libraries/LibC/sys/stat.cpp
Normal file
35
userspace/libraries/LibC/sys/stat.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int chmod(const char* path, mode_t mode)
|
||||
{
|
||||
return syscall(SYS_CHMOD, path, mode);
|
||||
}
|
||||
|
||||
int fstat(int fildes, struct stat* buf)
|
||||
{
|
||||
return syscall(SYS_FSTAT, fildes, buf);
|
||||
}
|
||||
|
||||
int fstatat(int fd, const char* __restrict path, struct stat* __restrict buf, int flag)
|
||||
{
|
||||
return syscall(SYS_FSTATAT, fd, path, buf, flag);
|
||||
}
|
||||
|
||||
int lstat(const char* __restrict path, struct stat* __restrict buf)
|
||||
{
|
||||
return syscall(SYS_STAT, path, buf, AT_SYMLINK_NOFOLLOW);
|
||||
}
|
||||
|
||||
int stat(const char* __restrict path, struct stat* __restrict buf)
|
||||
{
|
||||
return syscall(SYS_STAT, path, buf, 0);
|
||||
}
|
||||
|
||||
int mkdir(const char* path, mode_t mode)
|
||||
{
|
||||
return syscall(SYS_CREATE_DIR, path, mode);
|
||||
}
|
||||
Reference in New Issue
Block a user