2 * include/linux/signalfd.h
4 * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org>
8 #ifndef _LINUX_SIGNALFD_H
9 #define _LINUX_SIGNALFD_H
12 #include <linux/fcntl.h>
14 /* Flags for signalfd4. */
15 #define SFD_CLOEXEC O_CLOEXEC
17 struct signalfd_siginfo {
36 * Pad strcture to 128 bytes. Remember to update the
37 * pad size when you add new members. We use a fixed
38 * size structure to avoid compatibility problems with
39 * future versions, and we leave extra space for additional
40 * members. We use fixed size members because this strcture
41 * comes out of a read(2) and we really don't want to have
42 * a compat on read(2).
50 #ifdef CONFIG_SIGNALFD
53 * Deliver the signal to listening signalfd.
55 static inline void signalfd_notify(struct task_struct *tsk, int sig)
57 if (unlikely(waitqueue_active(&tsk->sighand->signalfd_wqh)))
58 wake_up(&tsk->sighand->signalfd_wqh);
61 #else /* CONFIG_SIGNALFD */
63 static inline void signalfd_notify(struct task_struct *tsk, int sig) { }
65 #endif /* CONFIG_SIGNALFD */
67 #endif /* __KERNEL__ */
69 #endif /* _LINUX_SIGNALFD_H */