Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kernel_wait4

Proto:long kernel_wait4(pid_t upid, int __user *stat_addr, int options, struct rusage *ru)

Type:long

Parameter:

TypeParameterName
pid_tupid
int __user *stat_addr
intoptions
struct rusage *ru
1586  struct pid * pid = NULL
1590  If options & ~( WNOHANG | WUNTRACED | WCONTINUED | Don't wait on children of other threads in this group | Wait only on non-SIGCHLD children | Wait on all children, regardless of type ) Then Return -EINVAL
1595  If upid == INT_MIN Then Return -ESRCH
1598  If upid == -1 Then type = PIDTYPE_MAX
1600  Else if upid < 0 Then
1601  type = PIDTYPE_PGID
1602  pid = Lookup a PID in the hash table, and return with it's count elevated.
1603  Else if upid == 0 Then
1604  type = PIDTYPE_PGID
1605  pid = get_task_pid(current process, PIDTYPE_PGID)
1606  Else
1607  type = PIDTYPE_PID
1608  pid = Lookup a PID in the hash table, and return with it's count elevated.
1611  wo_type = type
1612  wo_pid = pid
1613  wo_flags = options | WEXITED
1614  wo_info = NULL
1615  wo_stat = 0
1616  wo_rusage = ru
1617  ret = do_wait( & wo)
1618  put_pid(pid)
1619  If ret > 0 && stat_addr && Write a simple value into user space(wo_stat, stat_addr) Then ret = -EFAULT
1622  Return ret
Caller
NameDescribe
SYSCALL_DEFINE4
SYSCALL_DEFINE3sys_waitpid() remains for compatibility. waitpid() should be* implemented by calling sys_wait4() from libc.a.
COMPAT_SYSCALL_DEFINE4
call_usermodehelper_exec_syncHandles UMH_WAIT_PROC.
zap_pid_ns_processes