summaryrefslogtreecommitdiff
path: root/init/rlimit_parser_test.cpp
AgeCommit message (Collapse)Author
2020-02-06Convert system/core to Result::ok()Bernie Innocenti
No functionality changes, this is a mechanical cleanup. Test: m Test: cd system/core && atest Change-Id: Ifdaa3ce1947ed578f656d5a446978726eb416c36
2019-06-06Move result.h from init to libbaseJiyong Park
The Result, Error, ErrnoError are quite generic. Moving them from init to libbase so that they can be used from other places. Bug: 132145659 Test: libbase_test Change-Id: Id774a587f74380fadd7a0fc88c0aa892c3d9a489
2019-05-22init: replace Result<> with expected<>Tom Cherry
Android-base has an implementation of the future std::expected<>. This provides the same baseline functionality as Result<>, so use it instead of our own version. Bug: 132145659 Test: boot, init unit tests Change-Id: I11e61bcb5719b262a6420483ed51a762826a9e23
2018-08-22init: accept -1 or 'unlimited' for an infinite rlimitTom Cherry
Due to a bug with ParseUint(), init would defacto accept -1 for an infinite rlimit, but only on 64bit devices. That bug is now fixed, such that -1 would be rejected by ParseUint() for all devices. This change explicitly checks for -1 for all devices or 'unlimited' to match ulimit's reporting and accepts either as an infinite rlimit. Bug: 112668205 Test: new (and old) unit tests Change-Id: Ie28ff622cdf375a65ceb5f32ffb14fb3d5d9f2ba
2017-08-28init: support setting rlimits per serviceTom Cherry
Add a new service option, `rlimit` that allows a given rlimit to be set for a specific service instead of globally. Use the same parsing, now allowing text such as 'cpu' or 'rtprio' instead of relying on the enum value for the `setrlimit` builtin command as well. Bug: 63882119 Bug: 64894637 Test: boot bullhead, run a test app that attempts to set its rtprio to 95, see that the priority set fails normally but passes when `rlimit rtprio 99 99` is used as its service option. See that this fails when `rlimit rtprio 50 50` is used as well. Test: new unit tests Change-Id: I4a13ca20e8529937d8b4bc11718ffaaf77523a52