Kernel: Expose maximum argument limit in sysconf

Move the definitions for maximum argument and environment size to
Process.h from execve.cpp. This allows sysconf(_SC_ARG_MAX) to return
the actual argument maximum of 128 KiB to userspace.
This commit is contained in:
Andrew Kaster 2022-02-13 12:07:51 -07:00 committed by Idan Horowitz
commit b4a7d148b1
Notes: sideshowbarker 2024-07-17 18:54:20 +09:00
4 changed files with 8 additions and 5 deletions

View file

@ -434,6 +434,8 @@ public:
Custody* executable() { return m_executable.ptr(); }
const Custody* executable() const { return m_executable.ptr(); }
static constexpr size_t max_arguments_size = Thread::default_userspace_stack_size / 8;
static constexpr size_t max_environment_size = Thread::default_userspace_stack_size / 8;
NonnullOwnPtrVector<KString> const& arguments() const { return m_arguments; };
NonnullOwnPtrVector<KString> const& environment() const { return m_environment; };