2 * include/linux/signalfd.h
4 * Copyright (C) 2007 Davide Libenzi <davidel@xmailserver.org>
8 #ifndef _LINUX_SIGNALFD_H
9 #define _LINUX_SIGNALFD_H
11 #include <linux/types.h>
12 /* For O_CLOEXEC and O_NONBLOCK */
13 #include <linux/fcntl.h>
15 /* Flags for signalfd4. */
16 #define SFD_CLOEXEC O_CLOEXEC
17 #define SFD_NONBLOCK O_NONBLOCK
19 struct signalfd_siginfo
{
39 * Pad strcture to 128 bytes. Remember to update the
40 * pad size when you add new members. We use a fixed
41 * size structure to avoid compatibility problems with
42 * future versions, and we leave extra space for additional
43 * members. We use fixed size members because this strcture
44 * comes out of a read(2) and we really don't want to have
45 * a compat on read(2).
53 #ifdef CONFIG_SIGNALFD
56 * Deliver the signal to listening signalfd.
58 static inline void signalfd_notify(struct task_struct
*tsk
, int sig
)
60 if (unlikely(waitqueue_active(&tsk
->sighand
->signalfd_wqh
)))
61 wake_up(&tsk
->sighand
->signalfd_wqh
);
64 extern void signalfd_cleanup(struct sighand_struct
*sighand
);
66 #else /* CONFIG_SIGNALFD */
68 static inline void signalfd_notify(struct task_struct
*tsk
, int sig
) { }
70 static inline void signalfd_cleanup(struct sighand_struct
*sighand
) { }
72 #endif /* CONFIG_SIGNALFD */
74 #endif /* __KERNEL__ */
76 #endif /* _LINUX_SIGNALFD_H */