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