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:
parent
0323cae536
commit
ef16b3bb76
@ -2381,9 +2381,14 @@ getrlimit(int resource, struct rlimit * rlp)
|
|||||||
return vfs_getrlimit(resource, rlp);
|
return vfs_getrlimit(resource, rlp);
|
||||||
|
|
||||||
case RLIMIT_STACK:
|
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;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user