sched/posix_spawn: Don't insert name at the begin of argv

since the standard require the caller pass the name explicitly
https://pubs.opengroup.org/onlinepubs/009695399/functions/posix_spawn.html:
The argument argv is an array of character pointers to null-terminated strings.
The last member of this array shall be a null pointer and is not counted in argc.
These strings constitute the argument list available to the new process image.
The value in argv[0] should point to a filename that is associated with the
process image being started by the posix_spawn() or posix_spawnp() function.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id79ffcc501ae9552dc4e908418ff555f498be7f1
This commit is contained in:
Xiang Xiao
2021-06-13 13:43:38 +08:00
committed by patacongo
parent 9b8e81ebc1
commit 032086870d
7 changed files with 78 additions and 67 deletions
+1 -1
View File
@@ -168,7 +168,7 @@ int exec_module(FAR const struct binary_s *binp,
/* Initialize the task */
ret = nxtask_init(tcb, filename, binp->priority,
ret = nxtask_init(tcb, false, filename, binp->priority,
NULL, binp->stacksize, binp->entrypt, argv);
binfmt_freeargv(argv);
if (ret < 0)