Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kernel_waitid

Proto:static long kernel_waitid(int which, pid_t upid, struct waitid_info *infop, int options, struct rusage *ru)

Type:long

Parameter:

TypeParameterName
intwhich
pid_tupid
struct waitid_info *infop
intoptions
struct rusage *ru
1494  struct pid * pid = NULL
1498  If options & ~( WNOHANG | Don't reap, just poll status. | WEXITED | WSTOPPED | 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
1501  If Not (options & ( WEXITED | WSTOPPED | WCONTINUED)) Then Return -EINVAL
1505  Case which == First argument to waitid:
1506  type = PIDTYPE_MAX
1507  Break
1508  Case which == P_PID
1509  type = PIDTYPE_PID
1510  If upid <= 0 Then Return -EINVAL
1513  pid = Lookup a PID in the hash table, and return with it's count elevated.
1514  Break
1515  Case which == P_PGID
1516  type = PIDTYPE_PGID
1517  If upid < 0 Then Return -EINVAL
1520  If upid Then pid = Lookup a PID in the hash table, and return with it's count elevated.
1522  Else pid = get_task_pid(current process, PIDTYPE_PGID)
1524  Break
1525  Case which == P_PIDFD
1526  type = PIDTYPE_PID
1527  If upid < 0 Then Return -EINVAL
1530  pid = pidfd_get_pid(upid)
1531  If IS_ERR(pid) Then Return PTR_ERR(pid)
1533  Break
1534  Default
1535  Return -EINVAL
1538  wo_type = type
1539  wo_pid = pid
1540  wo_flags = options
1541  wo_info = infop
1542  wo_rusage = ru
1543  ret = do_wait( & wo)
1545  put_pid(pid)
1546  Return ret
Caller
NameDescribe
SYSCALL_DEFINE5
COMPAT_SYSCALL_DEFINE5