函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Let a parent know about the death of a child.* For a stopped/continued status change, use do_notify_parent_cldstop instead.* Returns true if our parent ignored us and so we've switched to* self-reaping.

函数原型:bool do_notify_parent(struct task_struct *tsk, int sig)

返回类型:bool

参数:

类型参数名称
struct task_struct *tsk
intsig
1910  bool autoreap = false
1913  BUG_ON(sig == - 1)
1916  BUG_ON(task_is_stopped_or_traced(tsk))
1918  BUG_ON(!ptrace && (线程组主管 != tsk || !thread_group_empty(tsk)))
1922  do_notify_pidfd(tsk)
1924  如果sig不等于SIGCHLD
1929  如果线程组跟踪不等于私有跟踪sig等于SIGCHLD
1933  clear_siginfo( & info)
1934  si_signo等于sig
1935  si_errno等于0
1947  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
1948  si_pid等于task_pid_nr_ns(tsk, task_active_pid_ns( Recipient of SIGCHLD, wait4() reports: ))
1949  si_uid等于from_kuid_munged(task_cred_xxx( Recipient of SIGCHLD, wait4() reports: , user_ns), task_uid(tsk))
1951  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
1953  task_cputime(tsk, & utime, & stime)
1954  si_utime等于nsec_to_clock_t(utime + 用户计时)
1955  si_stime等于nsec_to_clock_t(stime + 系统计时)
1957  si_status等于进程退出时发出的标号按位与0x7f
1958  如果进程退出时发出的标号按位与0x80则si_code等于child terminated abnormally
1960  否则如果进程退出时发出的标号按位与0x7f则si_code等于child was killed
1962  否则
1963  si_code等于child has exited
1964  si_status等于进程退出时发出的标号右移8位
1967  psig等于sighand
1968  spin_lock_irqsave( & siglock, flags)
1969  如果非ptracesig恒等于SIGCHLDsa_handler恒等于gnore signal sa_flags按位与SA_NOCLDWAIT的值则
1987  autoreap = true
1988  如果sa_handler恒等于gnore signal sig等于0
1991  如果Test if 'sig' is valid signal. Use this instead of testing _NSIG directly sig__group_send_sig_info(sig, & info, Recipient of SIGCHLD, wait4() reports: )
1993  __wake_up_parent(tsk, Recipient of SIGCHLD, wait4() reports: )
1994  spin_unlock_irqrestore( & siglock, flags)
1996  返回:autoreap
调用者
名称描述
reparent_leaderAny that need to be release_task'd are put on the @dead list.
exit_notifySend signals to all our closest relatives so that they know* to properly mourn us..
wait_task_zombieHandle sys_wait4 work for one task in state EXIT_ZOMBIE. We hold* read_lock(&tasklist_lock) on entry. If we return zero, we still hold* the lock and this task is uninteresting. If we return nonzero, we have
__ptrace_detachCalled with tasklist_lock held for writing
release_task