You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by ac...@apache.org on 2026/10/17 22:31:45 UTC
(nuttx) 03/04: Documentation: Describe the argument limits of a new task.
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.git
commit c25012f91529bdca51359dd2823ca7cd52b3ac9c
Author: Marco Casaroli <ma...@gmail.com>
AuthorDate: Sat Oct 17 19:58:53 2026 +0200
Documentation: Describe the argument limits of a new task.
CONFIG_TASK_MAX_ARGS sets the maximum number of arguments of a new
task, and CONFIG_TASK_ARG_MAX sets ARG_MAX. The documentation of
posix_spawn() and task_spawn() did not give these limits.
Describe both options at the argv parameter of posix_spawn(), and refer
to them from task_spawn().
Assisted-by: Claude Code:claude-opus-5-5
Signed-off-by: Marco Casaroli <ma...@gmail.com>
---
Documentation/reference/user/01_task_control.rst | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/Documentation/reference/user/01_task_control.rst b/Documentation/reference/user/01_task_control.rst
index 07ecddd7a5c..4c80a1dd0cb 100644
--- a/Documentation/reference/user/01_task_control.rst
+++ b/Documentation/reference/user/01_task_control.rst
@@ -629,6 +629,13 @@ Functions
``argv[]`` is an array of pointers to null-terminated strings. The
list is terminated with a null pointer.
+ A new task can get at most ``CONFIG_TASK_MAX_ARGS`` arguments (default
+ 256). A longer list fails with ``E2BIG``. ``CONFIG_TASK_ARG_MAX`` sets
+ ``ARG_MAX`` and ``sysconf(_SC_ARG_MAX)`` (default 4096 bytes): the size
+ of the arguments and the environment that a program may pass. NuttX
+ does not check this size. The arguments are copied to the stack of the
+ new task, so its stack must be large enough for them.
+
:param envp: ``envp[]`` is an array of pointers to null-terminated
``name=value`` strings that is the environment of the new task. The
array is terminated by a null pointer. If ``envp`` is ``NULL``, the new
@@ -917,7 +924,8 @@ Functions
:param argv: ``argv[]`` is the argument list for the new task.
``argv[]`` is an array of pointers to null-terminated strings. The
- list is terminated with a null pointer.
+ list is terminated with a null pointer. The limits of
+ :c:func:`posix_spawn` apply.
:param envp: The environment of the new task, as for
:c:func:`posix_spawn`. If ``envp`` is ``NULL``, the new task gets a