Kernel: Add non standard value to sys$sysconf
Add `_SC_PHYS_PAGES` to sys$sysconf syscall. This value is needed for a port I'm working on.
This commit is contained in:
parent
c705afa43a
commit
7c0b360881
Notes:
sideshowbarker
2024-07-17 00:53:02 +09:00
Author: https://github.com/fdellwing 🔰 Commit: https://github.com/SerenityOS/serenity/commit/7c0b360881 Pull-request: https://github.com/SerenityOS/serenity/pull/17790 Reviewed-by: https://github.com/AtkinsSJ ✅
2 changed files with 5 additions and 0 deletions
|
@ -45,6 +45,7 @@ enum {
|
|||
_SC_MAPPED_FILES,
|
||||
_SC_ARG_MAX,
|
||||
_SC_IOV_MAX,
|
||||
_SC_PHYS_PAGES,
|
||||
};
|
||||
|
||||
#define _SC_MONOTONIC_CLOCK _SC_MONOTONIC_CLOCK
|
||||
|
@ -60,6 +61,7 @@ enum {
|
|||
#define _SC_MAPPED_FILES _SC_MAPPED_FILES
|
||||
#define _SC_ARG_MAX _SC_ARG_MAX
|
||||
#define _SC_IOV_MAX _SC_IOV_MAX
|
||||
#define _SC_PHYS_PAGES _SC_PHYS_PAGES
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <Kernel/FileSystem/VirtualFileSystem.h>
|
||||
#include <Kernel/Memory/MemoryManager.h>
|
||||
#include <Kernel/Process.h>
|
||||
#include <Kernel/Time/TimeManagement.h>
|
||||
|
||||
|
@ -37,6 +38,8 @@ ErrorOr<FlatPtr> Process::sys$sysconf(int name)
|
|||
return Process::max_arguments_size;
|
||||
case _SC_IOV_MAX:
|
||||
return IOV_MAX;
|
||||
case _SC_PHYS_PAGES:
|
||||
return MM.get_system_memory_info().physical_pages;
|
||||
default:
|
||||
return EINVAL;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue