Kernel/LibC: Implement {,f}statvfs
This commit is contained in:
@@ -32,6 +32,7 @@ set(LIBC_SOURCES
|
||||
sys/select.cpp
|
||||
sys/socket.cpp
|
||||
sys/stat.cpp
|
||||
sys/statvfs.cpp
|
||||
sys/time.cpp
|
||||
sys/utsname.cpp
|
||||
sys/wait.cpp
|
||||
|
||||
@@ -48,6 +48,7 @@ __BEGIN_DECLS
|
||||
O(SYS_FCNTL, fcntl) \
|
||||
O(SYS_NANOSLEEP, nanosleep) \
|
||||
O(SYS_FSTATAT, fstatat) \
|
||||
O(SYS_FSTATVFSAT, fstatvfsat) \
|
||||
O(SYS_SYNC, sync) \
|
||||
O(SYS_MMAP, mmap) \
|
||||
O(SYS_MUNMAP, munmap) \
|
||||
|
||||
18
userspace/libraries/LibC/sys/statvfs.cpp
Normal file
18
userspace/libraries/LibC/sys/statvfs.cpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <fcntl.h>
|
||||
#include <sys/statvfs.h>
|
||||
#include <sys/syscall.h>
|
||||
|
||||
static int fstatvfsat(int fildes, const char* path, struct statvfs* buf)
|
||||
{
|
||||
return syscall(SYS_FSTATVFSAT, fildes, path, buf);
|
||||
}
|
||||
|
||||
int fstatvfs(int fildes, struct statvfs* buf)
|
||||
{
|
||||
return fstatvfsat(fildes, nullptr, buf);
|
||||
}
|
||||
|
||||
int statvfs(const char* __restrict path, struct statvfs* __restrict buf)
|
||||
{
|
||||
return fstatvfsat(AT_FDCWD, path, buf);
|
||||
}
|
||||
Reference in New Issue
Block a user