Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Davide Libenzi | fba2afa | 2007-05-10 22:23:13 -0700 | [diff] [blame] | 2 | /* |
| 3 | * include/linux/signalfd.h |
| 4 | * |
| 5 | * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org> |
| 6 | * |
| 7 | */ |
Davide Libenzi | fba2afa | 2007-05-10 22:23:13 -0700 | [diff] [blame] | 8 | #ifndef _LINUX_SIGNALFD_H |
| 9 | #define _LINUX_SIGNALFD_H |
| 10 | |
David Howells | 607ca46 | 2012-10-13 10:46:48 +0100 | [diff] [blame] | 11 | #include <uapi/linux/signalfd.h> |
Ingo Molnar | 3f07c01 | 2017-02-08 18:51:30 +0100 | [diff] [blame] | 12 | #include <linux/sched/signal.h> |
Davide Libenzi | fba2afa | 2007-05-10 22:23:13 -0700 | [diff] [blame] | 13 | |
| 14 | #ifdef CONFIG_SIGNALFD |
| 15 | |
| 16 | /* |
Davide Libenzi | b8fceee | 2007-09-20 12:40:16 -0700 | [diff] [blame] | 17 | * Deliver the signal to listening signalfd. |
Davide Libenzi | fba2afa | 2007-05-10 22:23:13 -0700 | [diff] [blame] | 18 | */ |
| 19 | static inline void signalfd_notify(struct task_struct *tsk, int sig) |
| 20 | { |
Davide Libenzi | b8fceee | 2007-09-20 12:40:16 -0700 | [diff] [blame] | 21 | if (unlikely(waitqueue_active(&tsk->sighand->signalfd_wqh))) |
| 22 | wake_up(&tsk->sighand->signalfd_wqh); |
Davide Libenzi | fba2afa | 2007-05-10 22:23:13 -0700 | [diff] [blame] | 23 | } |
| 24 | |
Oleg Nesterov | d80e731 | 2012-02-24 20:07:11 +0100 | [diff] [blame] | 25 | extern void signalfd_cleanup(struct sighand_struct *sighand); |
| 26 | |
Davide Libenzi | fba2afa | 2007-05-10 22:23:13 -0700 | [diff] [blame] | 27 | #else /* CONFIG_SIGNALFD */ |
| 28 | |
Davide Libenzi | b8fceee | 2007-09-20 12:40:16 -0700 | [diff] [blame] | 29 | static inline void signalfd_notify(struct task_struct *tsk, int sig) { } |
Davide Libenzi | fba2afa | 2007-05-10 22:23:13 -0700 | [diff] [blame] | 30 | |
Oleg Nesterov | d80e731 | 2012-02-24 20:07:11 +0100 | [diff] [blame] | 31 | static inline void signalfd_cleanup(struct sighand_struct *sighand) { } |
| 32 | |
Davide Libenzi | fba2afa | 2007-05-10 22:23:13 -0700 | [diff] [blame] | 33 | #endif /* CONFIG_SIGNALFD */ |
| 34 | |
Davide Libenzi | fba2afa | 2007-05-10 22:23:13 -0700 | [diff] [blame] | 35 | #endif /* _LINUX_SIGNALFD_H */ |