sched/task: Simplify the syscall handling of task_spawn

It's better to save one argument by returning pid directly.
This change also follow the convention of task_create.
BTW, it is reasonable to adjust the function prototype a
little bit from both implementation and consistency since
task_spawn is NuttX specific API.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Id74f4dd1ef26dfd8f7c473684cf1a45fbeee13cf
This commit is contained in:
Xiang Xiao
2021-05-12 11:34:50 +08:00
parent 0301992760
commit c997bf0f52
8 changed files with 34 additions and 178 deletions
+1 -1
View File
@@ -147,7 +147,7 @@ int posix_spawn(FAR pid_t *pid, FAR const char *path,
* 'name'.
*/
int task_spawn(FAR pid_t *pid, FAR const char *name, main_t entry,
int task_spawn(FAR const char *name, main_t entry,
FAR const posix_spawn_file_actions_t *file_actions,
FAR const posix_spawnattr_t *attr,
FAR char * const argv[], FAR char * const envp[]);