fxysunshine commented on code in PR #2205:
URL: https://github.com/apache/nuttx-apps/pull/2205#discussion_r1436688638


##########
testing/ostest/ostest_main.c:
##########
@@ -680,9 +715,19 @@ int main(int argc, FAR char **argv)
 
   /* Verify that we can spawn a new task */
 
+#ifdef CONFIG_BUILD_KERNEL
+  posix_spawnattr_init(&attr);
+  param.sched_priority = PRIORITY;
+  posix_spawnattr_setschedparam(&attr, &param);
+  posix_spawnattr_setstacksize(&attr, STACKSIZE);
+  status = posix_spawn(&result, arg[0], NULL, &attr,
+                       (char * const *)arg, NULL);
+  if (status != 0)
+#else
   result = task_create("ostest", PRIORITY, STACKSIZE, user_main,

Review Comment:
   Subtask user_main need check the argc and argv list, but no copy argv list 
in pthread_create for parameter. If need, should rework for user_main, but do 
not change anything if posix_spawn in kernel mode.
   static int user_main(int argc, char *argv[])



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to