nuttx-apps/testing/drivers
Marco Casaroli f1033082f9 netutils/dropbear, testing/nand_sim: do not use fork() to run in background.
Neither of these wants fork() semantics.  Both reach for fork() only to put
work in the background, and each has a NuttX-native way to do that, so
neither needs a fork primitive at all -- which matters once apache/nuttx#19562
makes ARCH_HAVE_FORK conditional on the architecture implementing POSIX
fork().

netutils/dropbear: the port already routes every fork-then-exec through
vfork(), because sysoptions.h selects DROPBEAR_VFORK when HAVE_FORK is
undefined and the port leaves it undefined.  spawn_command() in dbutil.c and
both call sites in scp.c follow that switch.  The one exception is the
daemon() fallback that compat.c compiles under #ifndef HAVE_DAEMON, which
calls fork() directly and bypasses it.  NuttX provides daemon() in
libs/libc/unistd/lib_daemon.c and declares it in unistd.h, so the fallback is
redundant; define HAVE_DAEMON alongside the HAVE_STRLCAT and HAVE_STRLCPY
entries that are there for exactly the same reason.  The code was unreachable
in any case -- the port hands svr_getopts() an argv containing -F, so
svr_opts.forkbg is always zero and dropbear never calls daemon() at all.

testing/drivers/nand_sim: forked so that the parent could return to the shell
while the child registered the MTD device and slept forever.  Nothing from
before the fork is used after it, so the child is a self-contained entry
point, and task_create() expresses that directly.  The emulator body moves
into nand_sim_daemon() unchanged.  TESTING_NAND_SIM therefore needs no fork
dependency, and the two sim configurations that enable it keep working
whatever ARCH_HAVE_FORK is set to.

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>
2026-08-03 09:22:39 -03:00
..
crypto crypto: Fix CRC-32 test case 8 2026-07-10 13:02:44 +08:00
drivertest testing/drivers: add watchdog notifier cmocka coverage 2026-07-21 15:37:01 -03:00
fftest testing/drivers/fftest/fftest.c: fix compilation error 2025-11-02 22:33:46 +08:00
nand_sim netutils/dropbear, testing/nand_sim: do not use fork() to run in background. 2026-08-03 09:22:39 -03:00
pcitest apps/testing:move {drivertest fftest irtest monkey nand_sim pcitest sd_bench sd_stress sensortest} folders to the new driver folder 2025-01-21 16:22:56 +08:00
rng/nist-sts testing: move nist-sts into drivers/rng directory 2026-01-29 12:08:50 +08:00
rpmsgdev testing: Move rpmsgdev to drivers/rpmsgdev 2025-01-26 09:53:02 -03:00
sd_stress testing/sd_stress: Harden file creation cleanup 2026-05-25 10:28:32 +08:00
ser testing: Add Serial Error Reporting testing app 2025-03-24 21:52:26 +08:00
setest testing: Move crypto/setest to drivers and open_memstream to libc 2025-01-26 07:32:53 +01:00
.gitignore apps/testing:move {drivertest fftest irtest monkey nand_sim pcitest sd_bench sd_stress sensortest} folders to the new driver folder 2025-01-21 16:22:56 +08:00
CMakeLists.txt apps/testing:move {drivertest fftest irtest monkey nand_sim pcitest sd_bench sd_stress sensortest} folders to the new driver folder 2025-01-21 16:22:56 +08:00
Make.defs apps/testing:move {drivertest fftest irtest monkey nand_sim pcitest sd_bench sd_stress sensortest} folders to the new driver folder 2025-01-21 16:22:56 +08:00
Makefile apps/testing: fix typo 2025-05-26 18:56:32 +02:00