nuttx-apps/testing
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
..
arch apps/testing: move himem_test,mtetest and x86-64-ABI folders to the new arhc folder 2025-01-20 17:48:48 +08:00
cmocka !testing/cmocka: Compile cmocka as a libary only by default 2026-01-12 10:14:55 +08:00
crypto !fsutils/passwd: Replace TEA with PBKDF2-HMAC-SHA256 2026-07-22 17:21:22 +08:00
cxx apps: Fix minor issues for latest toolchains 2026-01-23 10:00:52 +08:00
cxx-oot-build testing/cxx-oot-build: Exclude cxx-oot-build in CMake projects. 2025-10-15 14:34:32 +08:00
drivers netutils/dropbear, testing/nand_sim: do not use fork() to run in background. 2026-08-03 09:22:39 -03:00
enet apps/testing: add cmock_test for enet in order to test send and receive pkt 2025-12-29 22:30:56 +08:00
fff testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
fs testing/fs/xipfs: Cover the FDPIC module loader. 2026-07-31 18:47:17 -03:00
libc testing/libc/fopencookie/fopencookie.c: fix spellcheck 2026-06-29 12:29:42 +02:00
ltp testing, system: do not build tests that call fork() where it is absent. 2026-08-03 09:22:39 -03:00
mm !apps: drop redundant casts on tv_sec/tv_nsec and fix printf formats 2026-05-22 13:38:25 +08:00
nettest testing: nettest: Fix TCP server terminator bounds 2026-07-09 09:27:28 +08:00
nuts testing/nuts: NuttX Unit Test Selection (NUTS) application. 2025-12-28 10:28:14 +08:00
ostest testing/ostest: build the perf test only where it can link 2026-07-31 09:49:59 -03:00
sched testing/sched: fix off-by-one sample count in timerjitter 2026-07-11 12:31:24 -03:00
sig_sp_test testing/sig_sp_test: add test for SP context restore on signal return 2026-06-22 10:21:40 -03:00
testsuites apps: Fix O_ACCMODE bitmask checks after Linux flag alignment 2026-06-30 12:19:58 -04:00
unity apps/unity: Add printf configuration 2025-08-07 11:21:57 +08:00
.gitignore Ensure all source code end with one and only one newline 2020-02-09 08:14:49 -06:00
CMakeLists.txt testing/cxx-oot-build: Exclude cxx-oot-build in CMake projects. 2025-10-15 14:34:32 +08:00
Make.defs testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00
Makefile testing: migrate to SPDX identifier 2024-12-30 18:02:50 +08:00