#ifndef _LINUX_SCHED_SIGNAL_H
#define _LINUX_SCHED_SIGNAL_H
#include <linux/rculist.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/sched/jobctl.h>
#include <linux/sched/task.h>
#include <linux/cred.h>
#include <linux/refcount.h>
#include <linux/pid.h>
#include <linux/posix-timers.h>
#include <linux/mm_types.h>
#include <asm/ptrace.h>
struct sighand_struct { … };
struct pacct_struct { … };
struct cpu_itimer { … };
struct task_cputime_atomic { … };
#define INIT_CPUTIME_ATOMIC …
struct thread_group_cputimer { … };
struct multiprocess_signals { … };
struct core_thread { … };
struct core_state { … };
struct signal_struct { … } __randomize_layout;
#define SIGNAL_STOP_STOPPED …
#define SIGNAL_STOP_CONTINUED …
#define SIGNAL_GROUP_EXIT …
#define SIGNAL_CLD_STOPPED …
#define SIGNAL_CLD_CONTINUED …
#define SIGNAL_CLD_MASK …
#define SIGNAL_UNKILLABLE …
#define SIGNAL_STOP_MASK …
static inline void signal_set_stop_flags(struct signal_struct *sig,
unsigned int flags)
{ … }
extern void flush_signals(struct task_struct *);
extern void ignore_signals(struct task_struct *);
extern void flush_signal_handlers(struct task_struct *, int force_default);
extern int dequeue_signal(sigset_t *mask, kernel_siginfo_t *info, enum pid_type *type);
static inline int kernel_dequeue_signal(void)
{ … }
static inline void kernel_signal_stop(void)
{ … }
int force_sig_fault_to_task(int sig, int code, void __user *addr,
struct task_struct *t);
int force_sig_fault(int sig, int code, void __user *addr);
int send_sig_fault(int sig, int code, void __user *addr, struct task_struct *t);
int force_sig_mceerr(int code, void __user *, short);
int send_sig_mceerr(int code, void __user *, short, struct task_struct *);
int force_sig_bnderr(void __user *addr, void __user *lower, void __user *upper);
int force_sig_pkuerr(void __user *addr, u32 pkey);
int send_sig_perf(void __user *addr, u32 type, u64 sig_data);
int force_sig_ptrace_errno_trap(int errno, void __user *addr);
int force_sig_fault_trapno(int sig, int code, void __user *addr, int trapno);
int send_sig_fault_trapno(int sig, int code, void __user *addr, int trapno,
struct task_struct *t);
int force_sig_seccomp(int syscall, int reason, bool force_coredump);
extern int send_sig_info(int, struct kernel_siginfo *, struct task_struct *);
extern void force_sigsegv(int sig);
extern int force_sig_info(struct kernel_siginfo *);
extern int __kill_pgrp_info(int sig, struct kernel_siginfo *info, struct pid *pgrp);
extern int kill_pid_info(int sig, struct kernel_siginfo *info, struct pid *pid);
extern int kill_pid_usb_asyncio(int sig, int errno, sigval_t addr, struct pid *,
const struct cred *);
extern int kill_pgrp(struct pid *pid, int sig, int priv);
extern int kill_pid(struct pid *pid, int sig, int priv);
extern __must_check bool do_notify_parent(struct task_struct *, int);
extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
extern void force_sig(int);
extern void force_fatal_sig(int);
extern void force_exit_sig(int);
extern int send_sig(int, struct task_struct *, int);
extern int zap_other_threads(struct task_struct *p);
extern struct sigqueue *sigqueue_alloc(void);
extern void sigqueue_free(struct sigqueue *);
extern int send_sigqueue(struct sigqueue *, struct pid *, enum pid_type);
extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *);
static inline void clear_notify_signal(void)
{ … }
static inline bool __set_notify_signal(struct task_struct *task)
{ … }
static inline void set_notify_signal(struct task_struct *task)
{ … }
static inline int restart_syscall(void)
{ … }
static inline int task_sigpending(struct task_struct *p)
{ … }
static inline int signal_pending(struct task_struct *p)
{ … }
static inline int __fatal_signal_pending(struct task_struct *p)
{ … }
static inline int fatal_signal_pending(struct task_struct *p)
{ … }
static inline int signal_pending_state(unsigned int state, struct task_struct *p)
{ … }
static inline bool fault_signal_pending(vm_fault_t fault_flags,
struct pt_regs *regs)
{ … }
extern void recalc_sigpending(void);
extern void calculate_sigpending(void);
extern void signal_wake_up_state(struct task_struct *t, unsigned int state);
static inline void signal_wake_up(struct task_struct *t, bool fatal)
{ … }
static inline void ptrace_signal_wake_up(struct task_struct *t, bool resume)
{ … }
void task_join_group_stop(struct task_struct *task);
#ifdef TIF_RESTORE_SIGMASK
static inline void set_restore_sigmask(void)
{
set_thread_flag(TIF_RESTORE_SIGMASK);
}
static inline void clear_tsk_restore_sigmask(struct task_struct *task)
{
clear_tsk_thread_flag(task, TIF_RESTORE_SIGMASK);
}
static inline void clear_restore_sigmask(void)
{
clear_thread_flag(TIF_RESTORE_SIGMASK);
}
static inline bool test_tsk_restore_sigmask(struct task_struct *task)
{
return test_tsk_thread_flag(task, TIF_RESTORE_SIGMASK);
}
static inline bool test_restore_sigmask(void)
{
return test_thread_flag(TIF_RESTORE_SIGMASK);
}
static inline bool test_and_clear_restore_sigmask(void)
{
return test_and_clear_thread_flag(TIF_RESTORE_SIGMASK);
}
#else
static inline void set_restore_sigmask(void)
{ … }
static inline void clear_tsk_restore_sigmask(struct task_struct *task)
{ … }
static inline void clear_restore_sigmask(void)
{ … }
static inline bool test_restore_sigmask(void)
{ … }
static inline bool test_tsk_restore_sigmask(struct task_struct *task)
{ … }
static inline bool test_and_clear_restore_sigmask(void)
{ … }
#endif
static inline void restore_saved_sigmask(void)
{ … }
extern int set_user_sigmask(const sigset_t __user *umask, size_t sigsetsize);
static inline void restore_saved_sigmask_unless(bool interrupted)
{ … }
static inline sigset_t *sigmask_to_save(void)
{ … }
static inline int kill_cad_pid(int sig, int priv)
{ … }
#define SEND_SIG_NOINFO …
#define SEND_SIG_PRIV …
static inline int __on_sig_stack(unsigned long sp)
{ … }
static inline int on_sig_stack(unsigned long sp)
{ … }
static inline int sas_ss_flags(unsigned long sp)
{ … }
static inline void sas_ss_reset(struct task_struct *p)
{ … }
static inline unsigned long sigsp(unsigned long sp, struct ksignal *ksig)
{ … }
extern void __cleanup_sighand(struct sighand_struct *);
extern void flush_itimer_signals(void);
#define tasklist_empty() …
#define next_task(p) …
#define for_each_process(p) …
extern bool current_is_single_threaded(void);
#define while_each_thread(g, t) …
#define for_other_threads(p, t) …
#define __for_each_thread(signal, t) …
#define for_each_thread(p, t) …
#define for_each_process_thread(p, t) …
proc_visitor;
void walk_process_tree(struct task_struct *top, proc_visitor, void *);
static inline
struct pid *task_pid_type(struct task_struct *task, enum pid_type type)
{ … }
static inline struct pid *task_tgid(struct task_struct *task)
{ … }
static inline struct pid *task_pgrp(struct task_struct *task)
{ … }
static inline struct pid *task_session(struct task_struct *task)
{ … }
static inline int get_nr_threads(struct task_struct *task)
{ … }
static inline bool thread_group_leader(struct task_struct *p)
{ … }
static inline
bool same_thread_group(struct task_struct *p1, struct task_struct *p2)
{ … }
static inline struct task_struct *__next_thread(struct task_struct *p)
{ … }
static inline struct task_struct *next_thread(struct task_struct *p)
{ … }
static inline int thread_group_empty(struct task_struct *p)
{ … }
#define delay_group_leader(p) …
extern struct sighand_struct *__lock_task_sighand(struct task_struct *task,
unsigned long *flags);
static inline struct sighand_struct *lock_task_sighand(struct task_struct *task,
unsigned long *flags)
{ … }
static inline void unlock_task_sighand(struct task_struct *task,
unsigned long *flags)
{ … }
#ifdef CONFIG_LOCKDEP
extern void lockdep_assert_task_sighand_held(struct task_struct *task);
#else
static inline void lockdep_assert_task_sighand_held(struct task_struct *task) { }
#endif
static inline unsigned long task_rlimit(const struct task_struct *task,
unsigned int limit)
{ … }
static inline unsigned long task_rlimit_max(const struct task_struct *task,
unsigned int limit)
{ … }
static inline unsigned long rlimit(unsigned int limit)
{ … }
static inline unsigned long rlimit_max(unsigned int limit)
{ … }
#endif