Skip to content

Commit

Permalink
options/{posix,linux}: Relocate sys/{statfs.h,vfs.h} from the POSIX t…
Browse files Browse the repository at this point in the history
…o the Linux option
  • Loading branch information
mintsuki committed Jan 29, 2024
1 parent 0f39561 commit 02b1d0b
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <bits/ensure.h>

#include <mlibc/debug.hpp>
#include <mlibc/posix-sysdeps.hpp>
#include <mlibc/linux-sysdeps.hpp>

int statfs(const char *path, struct statfs *buf) {
MLIBC_CHECK_OR_ENOSYS(mlibc::sys_statfs, -1);
Expand Down
4 changes: 4 additions & 0 deletions options/linux/include/mlibc/linux-sysdeps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include <stdarg.h>
#include <sys/epoll.h>
#include <sys/sysinfo.h>
#include <sys/statfs.h>
#include <poll.h>
#include <abi-bits/pid_t.h>
#include <abi-bits/mode_t.h>
Expand Down Expand Up @@ -73,6 +74,9 @@ int sys_ioctl(int fd, unsigned long request, void *arg, int *result);
[[gnu::weak]] int sys_lremovexattr(const char *path, const char *name);
[[gnu::weak]] int sys_fremovexattr(int fd, const char *name);

[[gnu::weak]] int sys_statfs(const char *path, struct statfs *buf);
[[gnu::weak]] int sys_fstatfs(int fd, struct statfs *buf);

} // namespace mlibc

#endif // MLIBX_LINUX_SYSDEPS
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions options/linux/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ libc_sources += files(
'generic/capabilities.cpp',
'generic/cpuset.cpp',
'generic/sys-swap.cpp',
'generic/sys-statfs-stubs.cpp',
)

if not no_headers
Expand Down Expand Up @@ -83,6 +84,8 @@ if not no_headers
'include/sys/xattr.h',
'include/sys/quota.h',
'include/sys/swap.h',
'include/sys/statfs.h',
'include/sys/vfs.h',
subdir: 'sys'
)
install_headers(
Expand Down
3 changes: 0 additions & 3 deletions options/posix/include/mlibc/posix-sysdeps.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <sys/select.h>
#include <sys/sem.h>
#include <sys/statvfs.h>
#include <sys/statfs.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <sched.h>
Expand Down Expand Up @@ -191,8 +190,6 @@ int sys_vm_unmap(void *pointer, size_t size);
[[gnu::weak]] int sys_sigsuspend(const sigset_t *set);
[[gnu::weak]] int sys_sigpending(sigset_t *set);
[[gnu::weak]] int sys_setgroups(size_t size, const gid_t *list);
[[gnu::weak]] int sys_statfs(const char *path, struct statfs *buf);
[[gnu::weak]] int sys_fstatfs(int fd, struct statfs *buf);
[[gnu::weak]] int sys_memfd_create(const char *name, int flags, int *fd);
[[gnu::weak]] int sys_madvise(void *addr, size_t length, int advice);
[[gnu::weak]] int sys_msync(void *addr, size_t length, int flags);
Expand Down
3 changes: 0 additions & 3 deletions options/posix/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ libc_sources += files(
'generic/sys-select-stubs.cpp',
'generic/sys-shm.cpp',
'generic/sys-socket-stubs.cpp',
'generic/sys-statfs-stubs.cpp',
'generic/sys-stat-stubs.cpp',
'generic/sys-statvfs-stubs.cpp',
'generic/sys-times.cpp',
Expand Down Expand Up @@ -135,7 +134,6 @@ if not no_headers
'include/sys/sem.h',
'include/sys/shm.h',
'include/sys/socket.h',
'include/sys/statfs.h',
'include/sys/stat.h',
'include/sys/statvfs.h',
'include/sys/termios.h',
Expand All @@ -146,7 +144,6 @@ if not no_headers
'include/sys/uio.h',
'include/sys/un.h',
'include/sys/utsname.h',
'include/sys/vfs.h',
'include/sys/wait.h',
'include/sys/syslog.h',
subdir: 'sys'
Expand Down

0 comments on commit 02b1d0b

Please sign in to comment.