diff options
author | Brandon Potter <brandon.potter@amd.com> | 2019-03-11 14:13:47 -0400 |
---|---|---|
committer | Brandon Potter <Brandon.Potter@amd.com> | 2019-08-01 19:34:51 +0000 |
commit | 2b071a02e7e136cde1caf70f35a384f052b75cad (patch) | |
tree | d8c265d336204278422e2f7fd669325f0d1e3cbc /src | |
parent | 603f1378c0459f58593683782eaafb69500f0693 (diff) | |
download | gem5-2b071a02e7e136cde1caf70f35a384f052b75cad.tar.xz |
sim-se: add new option to getrlimit syscall
The NPROC option was not serviced by the getrlimit syscall.
This changeset adds in the necessary code to service the option.
Change-Id: I679d3949c3bbb0628188f4e33034028d7726fdcb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17109
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/sim/syscall_emul.hh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index d8270fb23..8a73cb2b7 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -1970,6 +1970,12 @@ getrlimitFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) rlp->rlim_max = TheISA::htog(rlp->rlim_max); break; + case OS::TGT_RLIMIT_NPROC: + rlp->rlim_cur = rlp->rlim_max = tc->getSystemPtr()->numContexts(); + rlp->rlim_cur = TheISA::htog(rlp->rlim_cur); + rlp->rlim_max = TheISA::htog(rlp->rlim_max); + break; + default: warn("getrlimit: unimplemented resource %d", resource); return -EINVAL; |