diff --git a/Kernel/API/POSIX/sys/statvfs.h b/Kernel/API/POSIX/sys/statvfs.h new file mode 100644 index 0000000000..9b09ccee87 --- /dev/null +++ b/Kernel/API/POSIX/sys/statvfs.h @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2018-2021, Andreas Kling + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define ST_RDONLY 0x1 +#define ST_NOSUID 0x2 + +struct statvfs { + unsigned long f_bsize; + unsigned long f_frsize; + fsblkcnt_t f_blocks; + fsblkcnt_t f_bfree; + fsblkcnt_t f_bavail; + + fsfilcnt_t f_files; + fsfilcnt_t f_ffree; + fsfilcnt_t f_favail; + + unsigned long f_fsid; + unsigned long f_flag; + unsigned long f_namemax; +}; + +#ifdef __cplusplus +} +#endif diff --git a/Kernel/UnixTypes.h b/Kernel/UnixTypes.h index ca0aa53450..fb245b81c5 100644 --- a/Kernel/UnixTypes.h +++ b/Kernel/UnixTypes.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -48,22 +49,3 @@ typedef u16 __u16; typedef u8 __u8; typedef int __s32; typedef short __s16; - -#define ST_RDONLY 0x1 -#define ST_NOSUID 0x2 - -struct statvfs { - unsigned long f_bsize; - unsigned long f_frsize; - fsblkcnt_t f_blocks; - fsblkcnt_t f_bfree; - fsblkcnt_t f_bavail; - - fsfilcnt_t f_files; - fsfilcnt_t f_ffree; - fsfilcnt_t f_favail; - - unsigned long f_fsid; - unsigned long f_flag; - unsigned long f_namemax; -}; diff --git a/Userland/Libraries/LibC/sys/statvfs.h b/Userland/Libraries/LibC/sys/statvfs.h index 4b34479a69..0530b60d80 100644 --- a/Userland/Libraries/LibC/sys/statvfs.h +++ b/Userland/Libraries/LibC/sys/statvfs.h @@ -6,31 +6,11 @@ #pragma once -#include -#include +#include __BEGIN_DECLS -#define ST_RDONLY 0x1 -#define ST_NOSUID 0x2 - -struct statvfs { - unsigned long f_bsize; - unsigned long f_frsize; - fsblkcnt_t f_blocks; - fsblkcnt_t f_bfree; - fsblkcnt_t f_bavail; - - fsfilcnt_t f_files; - fsfilcnt_t f_ffree; - fsfilcnt_t f_favail; - - unsigned long f_fsid; - unsigned long f_flag; - unsigned long f_namemax; -}; - -int statvfs(const char* path, struct statvfs* buf); +int statvfs(char const* path, struct statvfs* buf); int fstatvfs(int fd, struct statvfs* buf); __END_DECLS