Kernel: Avoid magic number in sys$poll

This commit is contained in:
Ben Wiederhake 2021-02-13 10:27:01 +01:00 committed by Andreas Kling
parent cc341c95aa
commit c0692f1f95
Notes: sideshowbarker 2024-07-18 22:19:57 +09:00

View file

@ -147,8 +147,7 @@ int Process::sys$poll(Userspace<const Syscall::SC_poll_params*> user_params)
if (!copy_from_user(&params, user_params))
return -EFAULT;
// This limit is just a number from the place where numbers come from.
if (params.nfds >= 16384)
if (params.nfds >= m_max_open_file_descriptors)
return -ENOBUFS;
Thread::BlockTimeout timeout;