Merge branch 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6-block.git] / include / linux / signalfd.h
CommitLineData
fba2afaa
DL
1/*
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
a788fd53 11#include <linux/types.h>
5fb5e049 12/* For O_CLOEXEC and O_NONBLOCK */
9deb27ba
UD
13#include <linux/fcntl.h>
14
15/* Flags for signalfd4. */
16#define SFD_CLOEXEC O_CLOEXEC
5fb5e049 17#define SFD_NONBLOCK O_NONBLOCK
fba2afaa
DL
18
19struct signalfd_siginfo {
96358de6
DL
20 __u32 ssi_signo;
21 __s32 ssi_errno;
22 __s32 ssi_code;
23 __u32 ssi_pid;
24 __u32 ssi_uid;
25 __s32 ssi_fd;
26 __u32 ssi_tid;
27 __u32 ssi_band;
28 __u32 ssi_overrun;
29 __u32 ssi_trapno;
30 __s32 ssi_status;
31 __s32 ssi_int;
32 __u64 ssi_ptr;
33 __u64 ssi_utime;
34 __u64 ssi_stime;
35 __u64 ssi_addr;
fba2afaa
DL
36
37 /*
38 * Pad strcture to 128 bytes. Remember to update the
14e4a0f2 39 * pad size when you add new members. We use a fixed
fba2afaa
DL
40 * size structure to avoid compatibility problems with
41 * future versions, and we leave extra space for additional
42 * members. We use fixed size members because this strcture
43 * comes out of a read(2) and we really don't want to have
44 * a compat on read(2).
45 */
46 __u8 __pad[48];
47};
48
49
50#ifdef __KERNEL__
51
52#ifdef CONFIG_SIGNALFD
53
54/*
b8fceee1 55 * Deliver the signal to listening signalfd.
fba2afaa
DL
56 */
57static inline void signalfd_notify(struct task_struct *tsk, int sig)
58{
b8fceee1
DL
59 if (unlikely(waitqueue_active(&tsk->sighand->signalfd_wqh)))
60 wake_up(&tsk->sighand->signalfd_wqh);
fba2afaa
DL
61}
62
63#else /* CONFIG_SIGNALFD */
64
b8fceee1 65static inline void signalfd_notify(struct task_struct *tsk, int sig) { }
fba2afaa
DL
66
67#endif /* CONFIG_SIGNALFD */
68
69#endif /* __KERNEL__ */
70
71#endif /* _LINUX_SIGNALFD_H */
72