casaroli opened a new pull request, #21124:
URL: https://github.com/apache/nuttx/pull/21124

   ## Summary
   
   `RLIMIT_RSS`, `RLIMIT_NPROC`, `RLIMIT_LOCKS` and `RLIMIT_SIGPENDING` were 
missing from `sys/resource.h`. Linux and the BSDs have them, and programs use 
them without a check (the `ulimit` command of shells, for example). Such 
programs did not compile.
   
   This PR adds them at the free values 9, 11, 12 and 13. NuttX does not 
enforce them: `getrlimit()` reports `RLIM_INFINITY`, as for the other limits 
that NuttX does not enforce, and `setrlimit()` fails with `EINVAL`, as for 
those. `RLIM_NLIMITS` (16) does not change.
   
   ## Impact
   
   Four new macros. `getrlimit()` of them returns 0 and `RLIM_INFINITY` 
(before: `EINVAL` for these values). No change for the existing limits. 
`Documentation/reference/user/01_task_control.rst` already says that 
`getrlimit()` reports the other resources as `RLIM_INFINITY` and that 
`setrlimit()` fails with `EINVAL` for them, so it does not change.
   
   ## Testing
   
   Test program `rlimitmore.c`: the four values differ from each other and from 
the other `RLIMIT_*` values and are below `RLIM_NLIMITS`; `getrlimit()` of each 
returns 0 and `RLIM_INFINITY`; `setrlimit()` of each fails with `EINVAL`.
   
   | Build | Config | master (aeab6fbf989) | this PR |
   |---|---|---|---|
   | kernel, arm64 | `qemu-armv8a:knsh` (QEMU, HVF) | does not compile (no 
`RLIMIT_RSS` ...) | values, get, set: PASS; ostest 0 |
   | flat, arm64 | `qemu-armv8a:nsh` (QEMU, HVF; the test as a builtin app) | | 
values, get, set: PASS; ostest 0 |
   
   Builds (make): `mps2-an500:knsh` (protected, armv7-m), `rv-virt:knsh64` 
(kernel, risc-v), `nucleo-f072rb:nsh` (flat, armv6-m): OK.
   
   `tools/checkpatch.sh -c -u -m -g` passes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to