llvm/libc/src/sys/statvfs/linux/statfs_utils.h

//===-- Convert Statfs to Statvfs -------------------------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//

#ifndef LLVM_LIBC_SRC_SYS_STATVFS_LINUX_STATFS_TO_STATVFS_H
#define LLVM_LIBC_SRC_SYS_STATVFS_LINUX_STATFS_TO_STATVFS_H

#include "include/llvm-libc-types/struct_statvfs.h"
#include "src/__support/CPP/optional.h"
#include "src/__support/OSUtil/syscall.h"
#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
#include "src/errno/libc_errno.h"
#include <asm/statfs.h>
#include <sys/syscall.h>
namespace LIBC_NAMESPACE_DECL {

namespace statfs_utils {
#ifdef SYS_statfs64
using LinuxStatFs = statfs64;
#else
LinuxStatFs;
#endif

// Linux kernel set an additional flag to f_flags. Libc should mask it out.
LIBC_INLINE_VAR constexpr decltype(LinuxStatFs::f_flags) ST_VALID =;

LIBC_INLINE cpp::optional<LinuxStatFs> linux_statfs(const char *path) {}

LIBC_INLINE cpp::optional<LinuxStatFs> linux_fstatfs(int fd) {}

// must use 'struct' tag to refer to type 'statvfs' in this scope. There will be
// a function in the same namespace with the same name. For consistency, we use
// struct prefix for all statvfs/statfs related types.
LIBC_INLINE struct statvfs statfs_to_statvfs(const LinuxStatFs &in) {}
} // namespace statfs_utils
} // namespace LIBC_NAMESPACE_DECL

#endif // LLVM_LIBC_SRC_SYS_STATVFS_LINUX_STATFS_TO_STATVFS_H