blob: 4c9ff0910ae01d39f691a23c9acf5d1db48b06d2 [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 */
7
8#ifndef _LINUX_SIGNALFD_H
9#define _LINUX_SIGNALFD_H
10
11
12struct signalfd_siginfo {
13 __u32 signo;
14 __s32 err;
15 __s32 code;
16 __u32 pid;
17 __u32 uid;
18 __s32 fd;
19 __u32 tid;
20 __u32 band;
21 __u32 overrun;
22 __u32 trapno;
23 __s32 status;
24 __s32 svint;
25 __u64 svptr;
26 __u64 utime;
27 __u64 stime;
28 __u64 addr;
29
30 /*
31 * Pad strcture to 128 bytes. Remember to update the
32 * pad size when you add new memebers. We use a fixed
33 * size structure to avoid compatibility problems with
34 * future versions, and we leave extra space for additional
35 * members. We use fixed size members because this strcture
36 * comes out of a read(2) and we really don't want to have
37 * a compat on read(2).
38 */
39 __u8 __pad[48];
40};
41
42
43#ifdef __KERNEL__
44
45#ifdef CONFIG_SIGNALFD
46
47/*
Davide Libenzib8fceee2007-09-20 12:40:16 -070048 * Deliver the signal to listening signalfd.
Davide Libenzifba2afa2007-05-10 22:23:13 -070049 */
50static inline void signalfd_notify(struct task_struct *tsk, int sig)
51{
Davide Libenzib8fceee2007-09-20 12:40:16 -070052 if (unlikely(waitqueue_active(&tsk->sighand->signalfd_wqh)))
53 wake_up(&tsk->sighand->signalfd_wqh);
Davide Libenzifba2afa2007-05-10 22:23:13 -070054}
55
56#else /* CONFIG_SIGNALFD */
57
Davide Libenzib8fceee2007-09-20 12:40:16 -070058static inline void signalfd_notify(struct task_struct *tsk, int sig) { }
Davide Libenzifba2afa2007-05-10 22:23:13 -070059
60#endif /* CONFIG_SIGNALFD */
61
62#endif /* __KERNEL__ */
63
64#endif /* _LINUX_SIGNALFD_H */
65