1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:37:35 +00:00

Kernel: Allocate new main thread stack before committing to exec

If the allocation fails (e.g ENOMEM) we want to simply return an error
from sys$execve() and continue executing the current executable.

This patch also moves make_userspace_stack_for_main_thread() out of the
Thread class since it had nothing in particular to do with Thread.
This commit is contained in:
Andreas Kling 2020-12-25 16:20:26 +01:00
parent d55fb7b5e2
commit 89d3b09638
4 changed files with 77 additions and 77 deletions

View file

@ -426,9 +426,10 @@ public:
size_t size { 0 };
FlatPtr program_headers { 0 };
size_t num_program_headers { 0 };
AK::WeakPtr<Region> tls_region;
WeakPtr<Region> tls_region;
size_t tls_size { 0 };
size_t tls_alignment { 0 };
WeakPtr<Region> stack_region;
};
enum class ShouldAllocateTls {