This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit e649e86246af8cfff858780de24ba3764d862d5e
Author: Marco Casaroli <[email protected]>
AuthorDate: Sun Oct 18 22:51:49 2026 +0200

    system/popen: Let its users take the popen() of libc too.
    
    The fastboot shell command, the popen test and the popen example
    depended on CONFIG_SYSTEM_POPEN, and dhcpd and gdbstub used popen() only
    with it.  libc now has popen(), pclose(), dpopen() and dpclose() when
    CONFIG_PIPES, CONFIG_LIBC_EXECFUNCS and CONFIG_SCHED_WAITPID are set.
    
    Let these users take either copy, so that a configuration can disable
    CONFIG_SYSTEM_POPEN and keep them.
    
    Assisted-by: Claude Code:claude-opus-5-5
    Signed-off-by: Marco Casaroli <[email protected]>
---
 examples/popen/Kconfig     | 2 +-
 netutils/dhcpd/dhcpd.c     | 3 ++-
 system/fastboot/Kconfig    | 2 +-
 system/gdbstub/gdbstub.c   | 3 ++-
 testing/libc/popen/Kconfig | 2 +-
 5 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/examples/popen/Kconfig b/examples/popen/Kconfig
index 2f571d121..ebe65d468 100644
--- a/examples/popen/Kconfig
+++ b/examples/popen/Kconfig
@@ -6,7 +6,7 @@
 config EXAMPLES_POPEN
        tristate "popen() example"
        default n
-       depends on SYSTEM_POPEN
+       depends on SYSTEM_POPEN || (PIPES && LIBC_EXECFUNCS && SCHED_WAITPID)
        depends on !DISABLE_POSIX_TIMERS
        ---help---
                Enable the popen() example
diff --git a/netutils/dhcpd/dhcpd.c b/netutils/dhcpd/dhcpd.c
index e6b469bc8..47e7b737d 100644
--- a/netutils/dhcpd/dhcpd.c
+++ b/netutils/dhcpd/dhcpd.c
@@ -1525,7 +1525,8 @@ static pid_t dhcpd_get_pid(void)
 
 #if !defined(CONFIG_BUILD_KERNEL)
   pid = g_dhcpd_daemon.ds_pid;
-#elif defined(CONFIG_SYSTEM_POPEN)
+#elif defined(CONFIG_SYSTEM_POPEN) || (defined(CONFIG_PIPES) && \
+      defined(CONFIG_LIBC_EXECFUNCS) && defined(CONFIG_SCHED_WAITPID))
   FAR FILE *fp;
   char line[32];
 
diff --git a/system/fastboot/Kconfig b/system/fastboot/Kconfig
index 966027376..fe0183ac5 100644
--- a/system/fastboot/Kconfig
+++ b/system/fastboot/Kconfig
@@ -58,7 +58,7 @@ config SYSTEM_FASTBOOTD_SHELL
        bool "Execute custom commands"
        default n
        depends on SCHED_CHILD_STATUS
-       depends on SYSTEM_POPEN
+       depends on SYSTEM_POPEN || (PIPES && LIBC_EXECFUNCS && SCHED_WAITPID)
        ---help---
                Enable to support executing custom commands.
                e.g. fastboot oem shell ps
diff --git a/system/gdbstub/gdbstub.c b/system/gdbstub/gdbstub.c
index 757d31676..a93c8c78d 100644
--- a/system/gdbstub/gdbstub.c
+++ b/system/gdbstub/gdbstub.c
@@ -38,7 +38,8 @@
 
 static int gdb_monitor(FAR struct gdb_state_s *state, FAR const char *cmd)
 {
-#ifdef CONFIG_SYSTEM_POPEN
+#if defined(CONFIG_SYSTEM_POPEN) || (defined(CONFIG_PIPES) && \
+    defined(CONFIG_LIBC_EXECFUNCS) && defined(CONFIG_SCHED_WAITPID))
   FAR FILE *file;
 
   file = popen(cmd, "r");
diff --git a/testing/libc/popen/Kconfig b/testing/libc/popen/Kconfig
index 73d4beb36..acb2dacc5 100644
--- a/testing/libc/popen/Kconfig
+++ b/testing/libc/popen/Kconfig
@@ -6,7 +6,7 @@
 config TESTING_POPEN
        tristate "popen()/dpopen() test"
        default n
-       depends on SYSTEM_POPEN
+       depends on SYSTEM_POPEN || (PIPES && LIBC_EXECFUNCS && SCHED_WAITPID)
        ---help---
                Test popen()/pclose() and dpopen()/dpclose() in both shell
                and no-shell modes. The test binary doubles as its own

Reply via email to