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
This commit is contained in:
François Revol 2008-04-10 21:56:22 +00:00
parent 0323cae536
commit ef16b3bb76

View File

@ -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;