From ef16b3bb765a551f1d415c72ee1489db11b498fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Thu, 10 Apr 2008 21:56:22 +0000 Subject: [PATCH] Use the thread's stack size for RLIMIT_STACK, this should work even if we ever implement changing a thread's stack. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24898 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/thread.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/thread.cpp b/src/system/kernel/thread.cpp index 818a8a5334..cf21b07cf5 100644 --- a/src/system/kernel/thread.cpp +++ b/src/system/kernel/thread.cpp @@ -2381,9 +2381,14 @@ getrlimit(int resource, struct rlimit * rlp) return vfs_getrlimit(resource, rlp); case RLIMIT_STACK: - rlp->rlim_cur = USER_STACK_SIZE; - rlp->rlim_max = USER_STACK_SIZE; + { + struct thread *thread = thread_get_current_thread(); + if (!thread) + return B_ERROR; + rlp->rlim_cur = thread->user_stack_size; + rlp->rlim_max = thread->user_stack_size; return 0; + } default: return EINVAL;