fxysunshine opened a new pull request, #22570:
URL: https://github.com/apache/nuttx/pull/22570
## Summary
* `_POSIX_*` constants are the POSIX-mandated fixed minimums, but
`_POSIX_SSIZE_MAX/_POSIX_SSIZE_MIN` varied with `CONFIG_SMALL_MEMORY`
(`LONG_MAX`/`LONG_MIN` on normal builds), conflating the POSIX minimum with the
implementation limit. Lift them out of the `#ifdef` as fixed constants
(`32767`/`-32768`); the implementation-facing `SSIZE_MAX`/`SSIZE_MIN` macros
switch on `CONFIG_SMALL_MEMORY` directly and keep their previous values for
every build configuration.
* `sysconf(_SC_SIGQUEUE_MAX)` reported `SIGQUEUE_MAX` (32) although NuttX
never enforces a pending-signal queue count (its only `-EAGAIN` paths in
`nxsig_dispatch()` are interrupt-context and idle-task memory restrictions, not
a count limit). Report -1 ("no limit") without setting `errno`, per POSIX.
* Continues the `_POSIX_*` invariant-constant cleanup started in
35c6d67743e.
## Impact
* Is new feature added? NO — a POSIX conformance reporting fix.
* Impact on user (will something change for someone operating the system)?
`SSIZE_MAX`/`SSIZE_MIN` are unchanged for all configurations.
`_POSIX_SSIZE_MAX` changes from `LONG_MAX` to `32767` on
non-`CONFIG_SMALL_MEMORY` builds (no in-tree code references this macro outside
of `<limits.h>`). `sysconf(_SC_SIGQUEUE_MAX)` now returns -1 (indeterminate)
instead of 32.
* Impact on documentation? NO.
* Impact on security? NO.
* Impact on compatibility? Callers that treated 32 as a guaranteed queue
depth will now see "no limit"; both are conforming, and 32 was never enforced.
## Testing
I confirm that changes are verified on local setup and works as intended:
* Build Host(s): Linux x86_64, Ubuntu 22.04, gcc 13.4.0
* Target(s): `sim:nsh` (Make and CMake builds), `ostest` exits with status 0
* Testing logs before change: `RESULT: PASS` on `upstream/master` at the
merge base (sim:nsh, ostest, CMake, checkpatch via `tools/checkpatch.sh`)
* Testing logs after change: `RESULT: PASS` on both commits
(`tools/checkpatch.sh`, `sim:nsh` make build with `ostest` run and CMake build
all green); the `CONFIG_SMALL_MEMORY` header branches were verified by
inspection to produce identical `SSIZE_MAX`/`SSIZE_MIN` values.
* Verified on sim only; no real-hardware run for this header/libc-only
change.
## PR verification Self-Check
* [X] This PR introduces only one functional change.
* [X] I have updated all required description fields above.
* [X] My PR adheres to Contributing Guidelines and Documentation (git
commit title and message, coding standard, etc).
* [ ] My PR is still work in progress (not ready for review).
* [X] My PR is ready for review and can be safely merged into a codebase.
Signed-off-by: fangxinyong <[email protected]>
--
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]