mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 20:05:54 +00:00
parent
3fb5ae4fdc
commit
2471410fe5
@ -49,12 +49,15 @@ extern "C" long sysconf(int name)
|
||||
switch (name) {
|
||||
case _SC_CHILD_MAX: return CHILD_MAX;
|
||||
case _SC_OPEN_MAX: return getdtablesize();
|
||||
case _SC_NPROCESSORS_CONF: return 1;
|
||||
case _SC_NPROCESSORS_ONLN: return 1;
|
||||
case _SC_PAGESIZE: return PAGESIZE;
|
||||
|
||||
case _SC_PHYS_PAGES:
|
||||
return _global_env->pd().ram_quota().value / PAGESIZE;
|
||||
case _SC_NPROCESSORS_CONF:
|
||||
[[fallthrough]];
|
||||
case _SC_NPROCESSORS_ONLN: {
|
||||
Affinity::Space space = _global_env->cpu().affinity_space();
|
||||
return space.total() ? : 1;
|
||||
}
|
||||
default:
|
||||
warning(__func__, "(", name, ") not implemented");
|
||||
return Errno(EINVAL);
|
||||
@ -155,7 +158,9 @@ extern "C" int __sysctl(const int *name, u_int namelen,
|
||||
return 0;
|
||||
|
||||
case HW_NCPU:
|
||||
*(int*)oldp = 1;
|
||||
Affinity::Space space = _global_env->cpu().affinity_space();
|
||||
|
||||
*(int*)oldp = space.total() ? : 1;
|
||||
*oldlenp = sizeof(int);
|
||||
return 0;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user