hc
2024-03-22 f63cd4c03ea42695d5f9b0e1798edd196923aae6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/* SPDX-License-Identifier: GPL-2.0 */
/*
 *  include/linux/signalfd.h
 *
 *  Copyright (C) 2007  Davide Libenzi <davidel@xmailserver.org>
 *
 */
#ifndef _LINUX_SIGNALFD_H
#define _LINUX_SIGNALFD_H
 
#include <uapi/linux/signalfd.h>
#include <linux/sched/signal.h>
 
#ifdef CONFIG_SIGNALFD
 
/*
 * Deliver the signal to listening signalfd.
 */
static inline void signalfd_notify(struct task_struct *tsk, int sig)
{
   if (unlikely(waitqueue_active(&tsk->sighand->signalfd_wqh)))
       wake_up(&tsk->sighand->signalfd_wqh);
}
 
extern void signalfd_cleanup(struct sighand_struct *sighand);
 
#else /* CONFIG_SIGNALFD */
 
static inline void signalfd_notify(struct task_struct *tsk, int sig) { }
 
static inline void signalfd_cleanup(struct sighand_struct *sighand) { }
 
#endif /* CONFIG_SIGNALFD */
 
#endif /* _LINUX_SIGNALFD_H */