no1wudi opened a new pull request, #17380:
URL: https://github.com/apache/nuttx/pull/17380
## Summary
Replace the pipe() macro definition with a proper function implementation to
improve POSIX compliance and debugging capabilities. The new pipe() function
serves as a wrapper around pipe2() with flags set to 0.
Changes include:
- Convert pipe() from macro to function declaration in unistd.h
- Add lib_pipe.c implementation file with proper function documentation
- Update build system files (CMakeLists.txt and Make.defs) to include the
new source file when CONFIG_PIPES is enabled
- Add pipe() entry to libc.csv for symbol tracking
This change allows for better debugging, proper symbol resolution, and
follows NuttX coding standards for library function implementations.
## Impact
* **Is new feature added? Is existing feature changed?**
NO - This is a refactoring change. The functionality remains identical;
only the implementation approach changes from macro to function.
* **Impact on user (will user need to adapt to change)?**
NO - The API signature and behavior remain exactly the same. User code
calling `pipe()` will continue to work without modification.
* **Impact on build (will build process change)?**
YES (minor) - An additional source file (`lib_pipe.c`) is now compiled
when `CONFIG_PIPES` is enabled. Build time impact is negligible (single small
source file). No configuration changes required.
* **Impact on hardware (will arch(s) / board(s) / driver(s) change)?**
NO - This change is purely in the C library layer and does not affect any
architecture-specific code, board configurations, or drivers.
* **Impact on documentation (is update required / provided)?**
NO - The user-facing API documentation remains valid. This is an internal
implementation change.
* **Impact on security (any sort of implications)?**
NO - The security properties remain identical. The function wrapper
performs the same operation as the previous macro.
* **Impact on compatibility (backward/forward/interoperability)?**
YES (improvement) - Improves binary compatibility and debugging
compatibility. Debuggers and profiling tools will now properly resolve the
`pipe()` symbol. Stack traces will show `pipe()` in call stacks instead of
expanded macro code.
## Testing
pipe relative tests (ltp & pipe example)
--
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]