txy-21 opened a new pull request, #18340:
URL: https://github.com/apache/nuttx/pull/18340

   # Summary
   
   Add library support for the rexec() function with conditional header 
inclusion based on build configurations.
   
   **Why:**
   The rexec() function requires different header files depending on the build 
configuration (kernel vs. flat builds) and feature enablement (file streams). 
Without proper conditional compilation guards, the code fails to build in 
certain configurations.
   
   **What changed:**
   - Modified `include/nuttx/lib/lib.h` to conditionally include headers:
     - Use `nuttx/kmalloc.h` for kernel builds (`__KERNEL__` defined)
     - Use `stdlib.h` for flat builds
     - Guard `nuttx/fs/fs.h` inclusion with `CONFIG_FILE_STREAM`
   - Updated `include/nuttx/streams.h` to add stream support for rexec
   - Enhanced netdb functions (`lib_getaddrinfo.c`, `lib_gethostentbynamer.c`) 
to support remote execution scenarios
   - Added necessary declarations in `libs/libc/netdb/lib_netdb.h`
   
   # Impact
   
   **Scope:**
   - **libc/netdb subsystem**: Enhanced network database functions for rexec 
support
   - **Build configurations**: Improved compatibility across different build 
modes
     - `CONFIG_BUILD_FLAT` - Uses standard library allocation
     - `CONFIG_BUILD_KERNEL` - Uses kernel memory allocator
     - `CONFIG_FILE_STREAM` - Conditionally includes file stream support
   
   **Affected files:**
   - `include/nuttx/lib/lib.h` - Header inclusion logic
   - `include/nuttx/streams.h` - Stream definitions
   - `libs/libc/netdb/lib_getaddrinfo.c` - Address info resolution
   - `libs/libc/netdb/lib_gethostentbynamer.c` - Host name resolution
   - `libs/libc/netdb/lib_netdb.h` - Network database declarations
   
   **Breaking changes:** None
   
   **Backward compatibility:** Fully maintained - existing code continues to 
work
   
   # Testing
   
   **Build testing:**
   Verified compilation across multiple configurations:
   ```bash
   # Flat build
   ./tools/configure.sh sim:nsh
   make clean && make
   # Build successful
   
   # With/without CONFIG_FILE_STREAM
   # Both configurations build successfully


-- 
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