mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-11 13:22:33 +00:00
noux: handle more libc getrlimit parameters
- we claim to have no limits on file handles and number of threads - remove obsolete Thread_base::myself fall-back code for stack size calculation Issue #1733.
This commit is contained in:
parent
2e62543fdb
commit
a608d48ddf
@ -282,16 +282,14 @@ extern "C" int getrlimit(int resource, struct rlimit *rlim)
|
||||
using namespace Genode;
|
||||
|
||||
Thread_base * me = Thread_base::myself();
|
||||
if (me) {
|
||||
addr_t top = reinterpret_cast<addr_t>(me->stack_top());
|
||||
addr_t cur = reinterpret_cast<addr_t>(me->stack_base());
|
||||
|
||||
rlim->rlim_cur = rlim->rlim_max = top - cur;
|
||||
return 0;
|
||||
}
|
||||
if (!me)
|
||||
break;
|
||||
|
||||
/* XXX - fix Thread_base::myself to be working also for main thread */
|
||||
rlim->rlim_cur = rlim->rlim_max = 64 * 1024;
|
||||
addr_t top = reinterpret_cast<addr_t>(me->stack_top());
|
||||
addr_t cur = reinterpret_cast<addr_t>(me->stack_base());
|
||||
|
||||
rlim->rlim_cur = rlim->rlim_max = top - cur;
|
||||
return 0;
|
||||
}
|
||||
case RLIMIT_AS:
|
||||
@ -304,6 +302,10 @@ extern "C" int getrlimit(int resource, struct rlimit *rlim)
|
||||
case RLIMIT_RSS:
|
||||
rlim->rlim_cur = rlim->rlim_max = Genode::env()->ram_session()->quota();
|
||||
return 0;
|
||||
case RLIMIT_NPROC:
|
||||
case RLIMIT_NOFILE:
|
||||
rlim->rlim_cur = rlim->rlim_max = RLIM_INFINITY;
|
||||
return 0;
|
||||
}
|
||||
errno = ENOSYS;
|
||||
PDBG("not implemented %d", resource);
|
||||
|
Loading…
x
Reference in New Issue
Block a user