LibCore: Add System::physical_memory_bytes()

This commit is contained in:
Jelle Raaijmakers 2024-10-08 15:48:17 +02:00 committed by Andreas Kling
parent 274411db97
commit 9515290fde
Notes: github-actions[bot] 2024-10-08 17:03:38 +00:00
2 changed files with 6 additions and 0 deletions

View file

@ -1751,6 +1751,11 @@ unsigned hardware_concurrency()
return sysconf(_SC_NPROCESSORS_ONLN);
}
u64 physical_memory_bytes()
{
return sysconf(_SC_PHYS_PAGES) * PAGE_SIZE;
}
ErrorOr<String> resolve_executable_from_environment(StringView filename, int flags)
{
if (filename.is_empty())

View file

@ -283,6 +283,7 @@ ErrorOr<void> posix_fallocate(int fd, off_t offset, off_t length);
#endif
unsigned hardware_concurrency();
u64 physical_memory_bytes();
ErrorOr<String> resolve_executable_from_environment(StringView filename, int flags = 0);