Lines Matching defs:tsk

455 	struct task_struct *tsk = current;
458 spin_lock_irqsave(&tsk->sighand->siglock, flags);
459 __flush_itimer_signals(&tsk->pending);
460 __flush_itimer_signals(&tsk->signal->shared_pending);
461 spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
495 int unhandled_signal(struct task_struct *tsk, int sig)
497 void __user *handler = tsk->sighand->action[sig-1].sa.sa_handler;
498 if (is_global_init(tsk))
503 return !tsk->ptrace;
559 int dequeue_signal(struct task_struct *tsk, sigset_t *mask, siginfo_t *info)
566 signr = __dequeue_signal(&tsk->pending, mask, info);
568 signr = __dequeue_signal(&tsk->signal->shared_pending,
584 struct hrtimer *tmr = &tsk->signal->real_timer;
587 tsk->signal->it_real_incr.tv64 != 0) {
589 tsk->signal->it_real_incr);
621 spin_unlock(&tsk->sighand->siglock);
623 spin_lock(&tsk->sighand->siglock);
1209 struct sighand_struct *__lock_task_sighand(struct task_struct *tsk,
1221 sighand = rcu_dereference(tsk->sighand);
1233 * We need to ensure that tsk->sighand is still the same
1239 if (likely(sighand == tsk->sighand)) {
1572 bool do_notify_parent(struct task_struct *tsk, int sig)
1583 BUG_ON(task_is_stopped_or_traced(tsk));
1585 BUG_ON(!tsk->ptrace &&
1586 (tsk->group_leader != tsk || !thread_group_empty(tsk)));
1593 if (tsk->parent_exec_id != tsk->parent->self_exec_id)
1611 info.si_pid = task_pid_nr_ns(tsk, task_active_pid_ns(tsk->parent));
1612 info.si_uid = from_kuid_munged(task_cred_xxx(tsk->parent, user_ns),
1613 task_uid(tsk));
1616 task_cputime(tsk, &utime, &stime);
1617 info.si_utime = cputime_to_clock_t(utime + tsk->signal->utime);
1618 info.si_stime = cputime_to_clock_t(stime + tsk->signal->stime);
1620 info.si_status = tsk->exit_code & 0x7f;
1621 if (tsk->exit_code & 0x80)
1623 else if (tsk->exit_code & 0x7f)
1627 info.si_status = tsk->exit_code >> 8;
1630 psig = tsk->parent->sighand;
1632 if (!tsk->ptrace && sig == SIGCHLD &&
1655 __group_send_sig_info(sig, &info, tsk->parent);
1656 __wake_up_parent(tsk, tsk->parent);
1664 * @tsk: task reporting the state change
1668 * Notify @tsk's parent that the stopped/continued state has changed. If
1669 * @for_ptracer is %false, @tsk's group leader notifies to its real parent.
1670 * If %true, @tsk reports to @tsk->parent which should be the ptracer.
1675 static void do_notify_parent_cldstop(struct task_struct *tsk,
1685 parent = tsk->parent;
1687 tsk = tsk->group_leader;
1688 parent = tsk->real_parent;
1697 info.si_pid = task_pid_nr_ns(tsk, task_active_pid_ns(parent));
1698 info.si_uid = from_kuid_munged(task_cred_xxx(parent, user_ns), task_uid(tsk));
1701 task_cputime(tsk, &utime, &stime);
1711 info.si_status = tsk->signal->group_exit_code & 0x7f;
1714 info.si_status = tsk->exit_code & 0x7f;
1728 __wake_up_parent(tsk, parent);
1760 static int sigkill_pending(struct task_struct *tsk)
1762 return sigismember(&tsk->pending.signal, SIGKILL) ||
1763 sigismember(&tsk->signal->shared_pending.signal, SIGKILL);
2356 static void retarget_shared_pending(struct task_struct *tsk, sigset_t *which)
2361 sigandsets(&retarget, &tsk->signal->shared_pending.signal, which);
2365 t = tsk;
2366 while_each_thread(tsk, t) {
2383 void exit_signals(struct task_struct *tsk)
2389 * @tsk is about to have PF_EXITING set - lock out users which
2392 threadgroup_change_begin(tsk);
2394 if (thread_group_empty(tsk) || signal_group_exit(tsk->signal)) {
2395 tsk->flags |= PF_EXITING;
2396 threadgroup_change_end(tsk);
2400 spin_lock_irq(&tsk->sighand->siglock);
2405 tsk->flags |= PF_EXITING;
2407 threadgroup_change_end(tsk);
2409 if (!signal_pending(tsk))
2412 unblocked = tsk->blocked;
2414 retarget_shared_pending(tsk, &unblocked);
2416 if (unlikely(tsk->jobctl & JOBCTL_STOP_PENDING) &&
2417 task_participate_group_stop(tsk))
2420 spin_unlock_irq(&tsk->sighand->siglock);
2428 do_notify_parent_cldstop(tsk, false, group_stop);
2459 static void __set_task_blocked(struct task_struct *tsk, const sigset_t *newset)
2461 if (signal_pending(tsk) && !thread_group_empty(tsk)) {
2465 retarget_shared_pending(tsk, &newblocked);
2467 tsk->blocked = *newset;
2486 struct task_struct *tsk = current;
2488 spin_lock_irq(&tsk->sighand->siglock);
2489 __set_task_blocked(tsk, newset);
2490 spin_unlock_irq(&tsk->sighand->siglock);
2503 struct task_struct *tsk = current;
2508 *oldset = tsk->blocked;
2512 sigorsets(&newset, &tsk->blocked, set);
2515 sigandnsets(&newset, &tsk->blocked, set);
2752 struct task_struct *tsk = current;
2775 spin_lock_irq(&tsk->sighand->siglock);
2776 sig = dequeue_signal(tsk, &mask, info);
2784 tsk->real_blocked = tsk->blocked;
2785 sigandsets(&tsk->blocked, &tsk->blocked, &mask);
2787 spin_unlock_irq(&tsk->sighand->siglock);
2791 spin_lock_irq(&tsk->sighand->siglock);
2792 __set_task_blocked(tsk, &tsk->real_blocked);
2793 sigemptyset(&tsk->real_blocked);
2794 sig = dequeue_signal(tsk, &mask, info);
2796 spin_unlock_irq(&tsk->sighand->siglock);