group/killchildren: replace syscall(2) to kernel api

syscall(2) cannot be called from kernel space

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2023-10-24 22:23:22 +08:00
committed by Xiang Xiao
parent 2b06142232
commit 50b17fb3fc
+4 -1
View File
@@ -32,6 +32,7 @@
#include <sys/types.h> #include <sys/types.h>
#include <nuttx/sched.h> #include <nuttx/sched.h>
#include <nuttx/signal.h>
#include "sched/sched.h" #include "sched/sched.h"
#include "group/group.h" #include "group/group.h"
@@ -201,9 +202,11 @@ int group_kill_children(FAR struct tcb_s *tcb)
while (1) while (1)
{ {
if (tcb->group->tg_nmembers <= 1) if (tcb->group->tg_nmembers <= 1)
{
break; break;
}
usleep(USEC_PER_MSEC); nxsig_usleep(USEC_PER_MSEC);
# if CONFIG_GROUP_KILL_CHILDREN_TIMEOUT_MS > 0 # if CONFIG_GROUP_KILL_CHILDREN_TIMEOUT_MS > 0
if (--ret < 0) if (--ret < 0)