3 ms·
But is the total size of all filenames combined much less than the stack size? The argument list is stored on the stack of the new process, and it still has to
by cesarb 5y ago
But is the total size of all filenames combined much less than the stack size? The argument list is stored on the stack of the new process, and it still has to leave enough space there for the program to use. See bprm_stack_limits in fs/exec.c for details.
- josephcsible 5y agoThe situation is worse than this. There's a hard limit of 6MB for arguments and environment variables combined, no matter how big the stack is: https://lore.kernel.org/lkml/20170707185729.GA70967@beast/T/#m1a27b742141be749be06f276730756642b90d635 https://lore.kernel.org/lkml/20170707185729.GA70967@beast/T/... (which was merged as commit da029c1).
- amelius 5y agoI don't know much about Linux kernel internals, but I suppose the stack grows down in a virtual address space, where pages of the stack are allocated as needed by the kernel (?)