mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 10:01:57 +00:00
parent
dfc2e2bd68
commit
2ff11dc063
@ -237,10 +237,15 @@ extern "C" {
|
|||||||
if (!attr || !*attr)
|
if (!attr || !*attr)
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
|
||||||
if (stacksize > (Thread::stack_virtual_size() - 4 * 4096) ||
|
if (stacksize < 4096)
|
||||||
stacksize < 4096)
|
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
|
||||||
|
size_t max_stack = Thread::stack_virtual_size() - 4 * 4096;
|
||||||
|
if (stacksize > max_stack) {
|
||||||
|
warning(__func__, ": requested stack size is ", stacksize, " limiting to ", max_stack);
|
||||||
|
stacksize = max_stack;
|
||||||
|
}
|
||||||
|
|
||||||
(*attr)->stack_size = Genode::align_addr(stacksize, 12);
|
(*attr)->stack_size = Genode::align_addr(stacksize, 12);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user