Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__send_signal

Proto:static int __send_signal(int sig, struct kernel_siginfo *info, struct task_struct *t, enum pid_type type, bool force)

Type:int

Parameter:

TypeParameterName
intsig
struct kernel_siginfo *info
struct task_struct *t
enum pid_typetype
boolforce
1071  ret = 0
1073  assert_spin_locked( & siglock)
1075  result = TRACE_SIGNAL_IGNORED
1076  If Not Handle magic process-wide effects of stop/continue signals Then Go to ret
1079  pending = If type != PIDTYPE_PID Then shared_pending Else pending
1085  result = TRACE_SIGNAL_ALREADY_PENDING
1086  If legacy_queue(pending, sig) Then Go to ret
1089  result = TRACE_SIGNAL_DELIVERED
1093  If sig == SIGKILL || Per task flags (PF_*), defined further below: & I am a kernel thread Then Go to out_set
1105  If sig < These should not be considered constants from userland. Then override_rlimit = is_si_special(info) || si_code >= 0
1107  Else override_rlimit = 0
1110  q = allocate a new signal queue record* - this may be called without locks if and only if t == current, otherwise an* appropriate lock must be held to stop the target task from exiting
1111  If q Then
1112  list_add_tail - add a new entry*@new: new entry to be added*@head: list head to add it before* Insert a new entry before the specified head.* This is useful for implementing queues.
1115  clear_siginfo( & info)
1116  si_signo = sig
1117  si_errno = 0
1126  Break
1127  Case info == SEND_SIG_PRIV
1128  clear_siginfo( & info)
1129  si_signo = sig
1130  si_errno = 0
1132  si_pid = 0
1133  si_uid = 0
1134  Break
1135  Default
1136  copy_siginfo( & info, info)
1137  Break
1139  Else if Not is_si_special(info) && sig >= These should not be considered constants from userland. && si_code != sent by kill, sigsend, raise Then
1146  result = TRACE_SIGNAL_OVERFLOW_FAIL
1147  ret = -EAGAIN
1148  Go to ret
1149  Else
1154  result = TRACE_SIGNAL_LOSE_INFO
1157  out_set :
1158  Deliver the signal to listening signalfd.
1159  We don't use for these because there is no need tobe atomic.
1162  If type > PIDTYPE_TGID Then
1165  signal = signal
1167  If sig == SIGCONT Then sigdelsetmask(signal, SIG_KERNEL_STOP_MASK)
1169  Else if sig_kernel_stop(sig) Then sigdelset(signal, SIGCONT)
1171  We don't use for these because there is no need tobe atomic.
1175  complete_signal(sig, t, type)
1176  ret :
1177  signal_generate - called when a signal is generated*@sig: signal number*@info: pointer to struct siginfo*@task: pointer to struct task_struct*@group: shared or private*@result: TRACE_SIGNAL_** Current process sends a 'sig' signal to 'task' process with
1178  Return ret
Caller
NameDescribe
send_signal
kill_pid_usb_asyncioThe usb asyncio usage of siginfo is wrong