Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\exit.c Create Date:2022-07-28 09:03:30
Last Modify:2020-03-17 11:17:32 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:wait_task_stopped - Wait for %TASK_STOPPED or %TASK_TRACED*@wo: wait options*@ptrace: is the wait for ptrace*@p: task to wait for* Handle sys_wait4() work for %p in state %TASK_STOPPED or %TASK_TRACED

Proto:static int wait_task_stopped(struct wait_opts *wo, int ptrace, struct task_struct *p)

Type:int

Parameter:

TypeParameterName
struct wait_opts *wo
intptrace
struct task_struct *p
1138  uid = 0
1144  If Not ptrace && Not (wo_flags & WUNTRACED) Then Return 0
1147  If Not task_stopped_code(p, ptrace) Then Return 0
1150  exit_code = 0
1151  spin_lock_irq( & siglock)
1153  p_code = task_stopped_code(p, ptrace)
1154  If Value for the false possibility is greater at compile time(!p_code) Then Go to unlock_sig
1157  exit_code = p_code
1158  If Not exit_code Then Go to unlock_sig
1161  If Not Value for the false possibility is greater at compile time(wo_flags & Don't reap, just poll status. ) Then p_code = 0
1164  uid = from_kuid_munged(current_user_ns(), task_uid(p))
1165  unlock_sig :
1166  spin_unlock_irq( & siglock)
1167  If Not exit_code Then Return 0
1177  get_task_struct(p)
1178  pid = task_pid_vnr(p)
1179  why = If ptrace Then raced child has trapped Else child has stopped
1180  read_unlock( & tasklist_lock)
1181  sched_annotate_sleep()
1182  If wo_rusage Then getrusage(p, sys_wait4() uses this , wo_rusage)
1184  put_task_struct(p)
1186  If Value is more likely to compile time(!(wo_flags & Don't reap, just poll status. )) Then wo_stat = exit_code << 8 | 0x7f
1189  infop = wo_info
1190  If infop Then
1191  cause = why
1192  status = exit_code
1193  pid = pid
1194  uid = uid
1196  Return pid
Caller
NameDescribe
wait_consider_taskConsider @p for a wait by @parent