Function Report

Linux Kernel (v4.4)

Source File:kernel\fork.c Create Date:2016-01-14 10:16:38
Last Modify:2016-01-11 07:01:32 Copyright©Brick
home page Tree
Annotate the kernelChinese

Function Name:copy_signal

Function:static int copy_signal(unsigned long clone_flags, struct task_struct *tsk)

Return Type:static int

Parameter:

Type Parameter NameRemarks
unsigned long clone_flags
struct task_struct * tsk

Function description:

1120  If clone_flags & Same thread group then Returning 0
1123  sig = * Shortcuts
1124  signal handlers = sig
1125  If !sig then Returning -Out of memory
1128  nr_threads = 1
1129  set atomic variable
1130  set atomic variable
1133  thread_head = Simple doubly linked list implementation.
1134  theead node = Simple doubly linked list implementation.
1136  init_waitqueue_head
1137  current thread group signal load-balancing target: = tsk
1138  Initialization signal transmission
1139  Initialization list head
1140  seqlock_init
1141  prev_cputime_init( &prev_cputime)
1143  initialize a timer to the given clock
1144  timer expiry callback function = The timer is automagically restarted, when interval!= 0
1146  Protects->fs,->files,->mm,->group_info,->comm, keyring subscriptions and synchronises with wait4(). Also used in procfs. Also pins the final release of task.io_context. Also protects->cpuset and->cgroup.subsys[]. And->vfork_done.
1147  Copy current process-> signal handlers-> We don't bother to synchronize most readers of this at all, because there is no reader checking a limit that actually needs to get both rlim_cur and rlim_max atomically, and either one alone is a single word that can safely be read normally to We don't bother to synchronize most readers of this at all, because there is no reader checking a limit that actually needs to get both rlim_cur and rlim_max atomically, and either one alone is a single word that can safely be read normally
1148  task_unlock(current process-> threadgroup leader)
1150  Initialize POSIX timer handling for a thread group.
1152  tty_audit_fork(sig)
1153  sched_autogroup_fork(sig)
1155  OOM kill score adjustment = current process-> signal handlers-> OOM kill score adjustment
1156  OOM kill score adjustment min value. Only settable by CAP_SYS_RESOURCE. = current process-> signal handlers-> OOM kill score adjustment min value. Only settable by CAP_SYS_RESOURCE.
1159  has_child_subreaper = current process-> signal handlers->has_child_subreaper || current process-> signal handlers-> PR_SET_CHILD_SUBREAPER marks a process, like a service manager, to re-parent orphan(double-forking) child processes to this process instead of'init'
1161  mutex_init
1163  Returning 0
Caller
Function NameFunction description
copy_processCreate a new process