static int copy_sighand(unsigned long clone_flags, struct task_struct *tsk) { struct sighand_struct *sig;
if (clone_flags & CLONE_SIGHAND) { atomic_inc(¤t->sighand->count); return 0; } sig = kmem_cache_alloc(sighand_cachep, GFP_KERNEL); rcu_assign_pointer(tsk->sighand, sig); if (!sig) return -ENOMEM;
atomic_set(&sig->count, 1); memcpy(sig->action, current->sighand->action, sizeof(sig->action)); return 0; }
进程创建时信号处理函数处理
最新推荐文章于 2022-09-06 17:01:04 发布