nuttx/Documentation/reference/user
Marco Casaroli 9b787d42b2 sched/arch/libc: make task_fork() optional
task_fork() is a NuttX extension, not POSIX, and a configuration that does
not call it has no reason to carry it.  Add CONFIG_TASK_FORK to leave it out.

It depends on ARCH_HAVE_TASK_FORK and defaults to y, so it is enabled exactly
where fork() existed before the split and no configuration loses the primitive
by upgrading.  ARCH_HAVE_TASK_FORK keeps its meaning -- the architecture *can*
clone the calling task -- and the new symbol says whether this build wants it.
Everything that provides task_fork() moves to the new symbol:  the declaration
in sched.h, up_task_fork() in arch.h, the two .csv entries that generate the
system call stub and proxy, the syscall_lookup.h table entry, the architecture
entry points, and the build rules for the files that hold them.

FORK_IS_TASK_FORK now depends on TASK_FORK rather than ARCH_HAVE_TASK_FORK.
Aliasing fork() to a task_fork() that was not built would not link.

vfork() and fork() are untouched; each is still selected on its own, and
task_fork.c, lib_fork.c and the architecture's fork file are still built when
any one of the three is present.

Signed-off-by: Marco Casaroli <marco.casaroli@gmail.com>

Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 11:45:24 +02:00
..
01_task_control.rst sched/arch/libc: make task_fork() optional 2026-07-30 11:45:24 +02:00
02_task_scheduling.rst Documentation: Fix a typo in scheduler docs 2025-06-02 23:09:02 +08:00
03_task_control.rst sched: Dynamically extend the pid hash table 2021-07-11 19:42:30 -07:00
04_message_queue.rst Documentation:fix error describe on message queue 2022-04-26 16:09:37 +08:00
05_counting_semaphore.rst sched/semaphore: add support to customize semaphore max allowed value 2025-09-04 09:48:34 +08:00
06_clocks_timers.rst Documentation: various cosmetic changes 2023-10-30 20:29:54 +08:00
07_signals.rst docs: Update Signal Interfaces documentation 2026-01-31 10:07:36 -03:00
08_pthread.rst pthread: add pthread_{get|set}concurrency support 2025-08-22 20:50:13 +08:00
09_env_vars.rst documentation: spelling and grammar fixes 2025-07-24 14:44:02 +08:00
10_filesystem.rst documentation: spelling and grammar fixes 2025-07-24 14:44:02 +08:00
11_network.rst 11_network.rst: Add a "Network Interfaces Overview" section and 2025-11-13 11:29:38 -03:00
12_shared_memory.rst Documentation: various cosmetic changes 2023-10-30 20:29:54 +08:00
13_boardctl.rst doc: Migrating the rest of documentation from cwiki. 2026-05-28 09:34:04 +08:00
14_logging.rst docs/guides/lwl: move lwl's README.txt to lwl.rst 2025-12-23 15:20:06 +01:00
index.rst Docs: Fix broken links and references in docs 2020-10-22 10:22:11 -03:00
structures.rst Documentation: various cosmetic changes 2023-10-30 20:29:54 +08:00