#include "base/process/process_metrics.h"
#include <limits.h>
#include <stddef.h>
#include <stdint.h>
#include <sys/time.h>
#include <unistd.h>
#include "base/allocator/buildflags.h"
#include "base/logging.h"
#include "build/blink_buildflags.h"
#include "build/build_config.h"
#if !BUILDFLAG(IS_FUCHSIA)
#include <sys/resource.h>
#endif
#if BUILDFLAG(IS_APPLE)
#include <malloc/malloc.h>
#else
#include <malloc.h>
#endif
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
#include <features.h>
#include "base/numerics/safe_conversions.h"
#endif
namespace base {
int64_t TimeValToMicroseconds(const struct timeval& tv) { … }
#if !BUILDFLAG(IS_FUCHSIA)
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS)
static const rlim_t kSystemDefaultMaxFds = …;
#elif BUILDFLAG(IS_APPLE)
static const rlim_t kSystemDefaultMaxFds = 256;
#elif BUILDFLAG(IS_SOLARIS)
static const rlim_t kSystemDefaultMaxFds = 8192;
#elif BUILDFLAG(IS_FREEBSD)
static const rlim_t kSystemDefaultMaxFds = 8192;
#elif BUILDFLAG(IS_NETBSD)
static const rlim_t kSystemDefaultMaxFds = 1024;
#elif BUILDFLAG(IS_OPENBSD)
static const rlim_t kSystemDefaultMaxFds = 256;
#elif BUILDFLAG(IS_ANDROID)
static const rlim_t kSystemDefaultMaxFds = 1024;
#elif BUILDFLAG(IS_AIX)
static const rlim_t kSystemDefaultMaxFds = 8192;
#endif
size_t GetMaxFds() { … }
size_t GetHandleLimit() { … }
void IncreaseFdLimitTo(unsigned int max_descriptors) { … }
#endif
#if BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
namespace {
size_t GetMallocUsageMallinfo() { … }
}
#endif
size_t ProcessMetrics::GetMallocUsage() { … }
}