blob: eadbe227c25648824c1bbf851c48b99f6ee5f7da [file] [log] [blame]
Davide Libenzifba2afa2007-05-10 22:23:13 -07001/*
2 * include/linux/signalfd.h
3 *
4 * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org>
5 *
6 */
Davide Libenzifba2afa2007-05-10 22:23:13 -07007#ifndef _LINUX_SIGNALFD_H
8#define _LINUX_SIGNALFD_H
9
David Howells607ca462012-10-13 10:46:48 +010010#include <uapi/linux/signalfd.h>
Ulrich Drepper9deb27b2008-07-23 21:29:24 -070011
Davide Libenzifba2afa2007-05-10 22:23:13 -070012
13#ifdef CONFIG_SIGNALFD
14
15/*
Davide Libenzib8fceee2007-09-20 12:40:16 -070016 * Deliver the signal to listening signalfd.
Davide Libenzifba2afa2007-05-10 22:23:13 -070017 */
18static inline void signalfd_notify(struct task_struct *tsk, int sig)
19{
Davide Libenzib8fceee2007-09-20 12:40:16 -070020 if (unlikely(waitqueue_active(&tsk->sighand->signalfd_wqh)))
21 wake_up(&tsk->sighand->signalfd_wqh);
Davide Libenzifba2afa2007-05-10 22:23:13 -070022}
23
Oleg Nesterovd80e7312012-02-24 20:07:11 +010024extern void signalfd_cleanup(struct sighand_struct *sighand);
25
Davide Libenzifba2afa2007-05-10 22:23:13 -070026#else /* CONFIG_SIGNALFD */
27
Davide Libenzib8fceee2007-09-20 12:40:16 -070028static inline void signalfd_notify(struct task_struct *tsk, int sig) { }
Davide Libenzifba2afa2007-05-10 22:23:13 -070029
Oleg Nesterovd80e7312012-02-24 20:07:11 +010030static inline void signalfd_cleanup(struct sighand_struct *sighand) { }
31
Davide Libenzifba2afa2007-05-10 22:23:13 -070032#endif /* CONFIG_SIGNALFD */
33
Davide Libenzifba2afa2007-05-10 22:23:13 -070034#endif /* _LINUX_SIGNALFD_H */