summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Kernel/Syscalls/sysconf.cpp2
-rw-r--r--Kernel/UnixTypes.h1
-rw-r--r--Libraries/LibC/unistd.h2
3 files changed, 5 insertions, 0 deletions
diff --git a/Kernel/Syscalls/sysconf.cpp b/Kernel/Syscalls/sysconf.cpp
index 5c25b41463..243d39ea55 100644
--- a/Kernel/Syscalls/sysconf.cpp
+++ b/Kernel/Syscalls/sysconf.cpp
@@ -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;
}
diff --git a/Kernel/UnixTypes.h b/Kernel/UnixTypes.h
index f056d48304..2d50eb65c6 100644
--- a/Kernel/UnixTypes.h
+++ b/Kernel/UnixTypes.h
@@ -60,6 +60,7 @@ enum {
_SC_NPROCESSORS_CONF,
_SC_NPROCESSORS_ONLN,
_SC_PAGESIZE,
+ _SC_OPEN_MAX
};
#define PERF_EVENT_MALLOC 1
diff --git a/Libraries/LibC/unistd.h b/Libraries/LibC/unistd.h
index 0faa5f4397..8d1e2bd6a0 100644
--- a/Libraries/LibC/unistd.h
+++ b/Libraries/LibC/unistd.h
@@ -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);