Serenity Operating System
at master 26 lines 557 B view raw
1/* 2 * Copyright (c) 2021, Justin Mietzner <sw1tchbl4d3@sw1tchbl4d3.com> 3 * 4 * SPDX-License-Identifier: BSD-2-Clause 5 */ 6 7#include <errno.h> 8#include <string.h> 9#include <sys/statvfs.h> 10#include <syscall.h> 11 12extern "C" { 13 14int statvfs(char const* path, struct statvfs* buf) 15{ 16 Syscall::SC_statvfs_params params { { path, strlen(path) }, buf }; 17 int rc = syscall(SC_statvfs, &params); 18 __RETURN_WITH_ERRNO(rc, rc, -1); 19} 20 21int fstatvfs(int fd, struct statvfs* buf) 22{ 23 int rc = syscall(SC_fstatvfs, fd, buf); 24 __RETURN_WITH_ERRNO(rc, rc, -1); 25} 26}