chromium/base/system/sys_info_posix.cc

// Copyright 2011 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/system/sys_info.h"

#include <errno.h>
#include <sched.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <sys/param.h>
#include <sys/resource.h>
#include <sys/utsname.h>
#include <unistd.h>

#include <algorithm>

#include "base/check.h"
#include "base/files/file_util.h"
#include "base/lazy_instance.h"
#include "base/notimplemented.h"
#include "base/notreached.h"
#include "base/numerics/safe_conversions.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
#include "base/system/sys_info_internal.h"
#include "base/threading/scoped_blocking_call.h"
#include "build/build_config.h"

#if BUILDFLAG(IS_ANDROID)
#include <sys/vfs.h>
#define statvfs
#else
#include <sys/statvfs.h>
#endif

#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
#include <linux/magic.h>
#include <sys/vfs.h>
#endif

#if BUILDFLAG(IS_MAC)
#include <optional>
#endif

namespace {

uint64_t AmountOfVirtualMemory() {}

base::LazyInstance<
    base::internal::LazySysInfoValue<uint64_t, AmountOfVirtualMemory>>::Leaky
    g_lazy_virtual_memory =;

#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
bool IsStatsZeroIfUnlimited(const base::FilePath& path) {}
#endif  // BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)

bool GetDiskSpaceInfo(const base::FilePath& path,
                      int64_t* available_bytes,
                      int64_t* total_bytes) {}

}  // namespace

namespace base {

#if !BUILDFLAG(IS_OPENBSD)
// static
int SysInfo::NumberOfProcessors() {}
#endif  // !BUILDFLAG(IS_OPENBSD)

// static
uint64_t SysInfo::AmountOfVirtualMemory() {}

// static
int64_t SysInfo::AmountOfFreeDiskSpace(const FilePath& path) {}

// static
int64_t SysInfo::AmountOfTotalDiskSpace(const FilePath& path) {}

#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_ANDROID)
// static
std::string SysInfo::OperatingSystemName() {}
#endif  //! BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_ANDROID)

#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
// static
std::string SysInfo::OperatingSystemVersion() {}
#endif

#if !BUILDFLAG(IS_APPLE) && !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS)
// static
void SysInfo::OperatingSystemVersionNumbers(int32_t* major_version,
                                            int32_t* minor_version,
                                            int32_t* bugfix_version) {}
#endif

#if !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_IOS)
// static
std::string SysInfo::OperatingSystemArchitecture() {}
#endif  // !BUILDFLAG(IS_MAC) && !BUILDFLAG(IS_IOS)

// static
size_t SysInfo::VMAllocationGranularity() {}

#if !BUILDFLAG(IS_APPLE)
// static
int SysInfo::NumberOfEfficientProcessorsImpl() {}
#endif  // !BUILDFLAG(IS_APPLE)

}  // namespace base