Kernel: Implement _SC_OPEN_MAX

This commit is contained in:
Luke 2020-09-09 08:35:02 +01:00 committed by Andreas Kling
parent db31452bc2
commit 721788943d
Notes: sideshowbarker 2024-07-19 02:11:18 +09:00
3 changed files with 5 additions and 0 deletions

View file

@ -37,6 +37,8 @@ long Process::sys$sysconf(int name)
return Processor::processor_count();
case _SC_PAGESIZE:
return PAGE_SIZE;
case _SC_OPEN_MAX:
return max_open_file_descriptors();
default:
return -EINVAL;
}

View file

@ -60,6 +60,7 @@ enum {
_SC_NPROCESSORS_CONF,
_SC_NPROCESSORS_ONLN,
_SC_PAGESIZE,
_SC_OPEN_MAX
};
#define PERF_EVENT_MALLOC 1

View file

@ -174,11 +174,13 @@ enum {
_SC_NPROCESSORS_CONF,
_SC_NPROCESSORS_ONLN,
_SC_PAGESIZE,
_SC_OPEN_MAX,
};
#define _SC_NPROCESSORS_CONF _SC_NPROCESSORS_CONF
#define _SC_NPROCESSORS_ONLN _SC_NPROCESSORS_ONLN
#define _SC_PAGESIZE _SC_PAGESIZE
#define _SC_OPEN_MAX _SC_OPEN_MAX
long sysconf(int name);