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