diff --git a/Kernel/Syscalls/dup2.cpp b/Kernel/Syscalls/dup2.cpp index ed0c8e74d0..2d082431cd 100644 --- a/Kernel/Syscalls/dup2.cpp +++ b/Kernel/Syscalls/dup2.cpp @@ -16,7 +16,7 @@ ErrorOr Process::sys$dup2(int old_fd, int new_fd) auto description = TRY(fds().open_file_description(old_fd)); if (old_fd == new_fd) return new_fd; - if (new_fd < 0 || static_cast(new_fd) >= fds().max_open()) + if (new_fd < 0 || static_cast(new_fd) >= OpenFileDescriptions::max_open()) return EINVAL; if (!m_fds.m_fds_metadatas[new_fd].is_allocated()) m_fds.m_fds_metadatas[new_fd].allocate(); diff --git a/Kernel/Syscalls/pipe.cpp b/Kernel/Syscalls/pipe.cpp index e517bf2d72..e090e028d0 100644 --- a/Kernel/Syscalls/pipe.cpp +++ b/Kernel/Syscalls/pipe.cpp @@ -13,7 +13,7 @@ ErrorOr Process::sys$pipe(int pipefd[2], int flags) { VERIFY_PROCESS_BIG_LOCK_ACQUIRED(this) REQUIRE_PROMISE(stdio); - if (fds().open_count() + 2 > fds().max_open()) + if (fds().open_count() + 2 > OpenFileDescriptions::max_open()) return EMFILE; // Reject flags other than O_CLOEXEC, O_NONBLOCK if ((flags & (O_CLOEXEC | O_NONBLOCK)) != flags) diff --git a/Kernel/Syscalls/poll.cpp b/Kernel/Syscalls/poll.cpp index 6b914cdc8c..670a1fa2a7 100644 --- a/Kernel/Syscalls/poll.cpp +++ b/Kernel/Syscalls/poll.cpp @@ -20,7 +20,7 @@ ErrorOr Process::sys$poll(Userspace use REQUIRE_PROMISE(stdio); auto params = TRY(copy_typed_from_user(user_params)); - if (params.nfds >= fds().max_open()) + if (params.nfds >= OpenFileDescriptions::max_open()) return ENOBUFS; Thread::BlockTimeout timeout; diff --git a/Kernel/Syscalls/sysconf.cpp b/Kernel/Syscalls/sysconf.cpp index ebe8b0e54b..6f9c562650 100644 --- a/Kernel/Syscalls/sysconf.cpp +++ b/Kernel/Syscalls/sysconf.cpp @@ -19,7 +19,7 @@ ErrorOr Process::sys$sysconf(int name) case _SC_NPROCESSORS_ONLN: return Processor::processor_count(); case _SC_OPEN_MAX: - return fds().max_open(); + return OpenFileDescriptions::max_open(); case _SC_PAGESIZE: return PAGE_SIZE; case _SC_HOST_NAME_MAX: