函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\exit.c Create Date:2022-07-27 10:03:29
Last Modify:2020-03-17 11:17:32 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:kernel_wait4

函数原型:long kernel_wait4(pid_t upid, int __user *stat_addr, int options, struct rusage *ru)

返回类型:long

参数:

类型参数名称
pid_tupid
int __user *stat_addr
intoptions
struct rusage *ru
1586  struct pid * pid = NULL
1590  如果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 的值的反则返回:负EINVAL
1595  如果upid恒等于INT_MIN则返回:负ESRCH
1598  如果upid恒等于负1则type等于最大进程
1600  否则如果upid小于0则
1601  type等于进程组
1602  pid等于Lookup a PID in the hash table, and return with it's count elevated.
1603  否则如果upid恒等于0则
1604  type等于进程组
1605  pid等于get_task_pid(当前进程, 进程组)
1606  否则
1607  type等于单一进程
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  如果ret大于0且stat_addrput_user - Write a simple value into user space(wo_stat, stat_addr)则ret等于负EFAULT
1622  返回:ret
调用者
名称描述
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