From 4ba39c8d6386989c4b7b51bbda409092fad4cd63 Mon Sep 17 00:00:00 2001 From: Tim Schumacher Date: Tue, 29 Mar 2022 02:53:12 +0200 Subject: [PATCH] Kernel: Implement `f_basetype` in statvfs --- Kernel/API/POSIX/sys/statvfs.h | 4 ++++ Kernel/Syscalls/statvfs.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/Kernel/API/POSIX/sys/statvfs.h b/Kernel/API/POSIX/sys/statvfs.h index 9b09ccee87..cb3ce6ddd8 100644 --- a/Kernel/API/POSIX/sys/statvfs.h +++ b/Kernel/API/POSIX/sys/statvfs.h @@ -15,6 +15,8 @@ extern "C" { #define ST_RDONLY 0x1 #define ST_NOSUID 0x2 +#define FSTYPSZ 16 + struct statvfs { unsigned long f_bsize; unsigned long f_frsize; @@ -29,6 +31,8 @@ struct statvfs { unsigned long f_fsid; unsigned long f_flag; unsigned long f_namemax; + + char f_basetype[FSTYPSZ]; }; #ifdef __cplusplus diff --git a/Kernel/Syscalls/statvfs.cpp b/Kernel/Syscalls/statvfs.cpp index 3b3d26d83a..8e8aa42cf0 100644 --- a/Kernel/Syscalls/statvfs.cpp +++ b/Kernel/Syscalls/statvfs.cpp @@ -30,6 +30,8 @@ ErrorOr Process::do_statvfs(FileSystem const& fs, Custody const* custod kernelbuf.f_namemax = 255; + (void)fs.class_name().copy_characters_to_buffer(kernelbuf.f_basetype, FSTYPSZ); + if (custody) kernelbuf.f_flag = custody->mount_flags();