]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - include/linux/signalfd.h
flag parameters: NONBLOCK in socket and socketpair
[mirror_ubuntu-bionic-kernel.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
9deb27ba
UD
11/* For O_CLOEXEC */
12#include <linux/fcntl.h>
13
14/* Flags for signalfd4. */
15#define SFD_CLOEXEC O_CLOEXEC
fba2afaa
DL
16
17struct signalfd_siginfo {
96358de6
DL
18 __u32 ssi_signo;
19 __s32 ssi_errno;
20 __s32 ssi_code;
21 __u32 ssi_pid;
22 __u32 ssi_uid;
23 __s32 ssi_fd;
24 __u32 ssi_tid;
25 __u32 ssi_band;
26 __u32 ssi_overrun;
27 __u32 ssi_trapno;
28 __s32 ssi_status;
29 __s32 ssi_int;
30 __u64 ssi_ptr;
31 __u64 ssi_utime;
32 __u64 ssi_stime;
33 __u64 ssi_addr;
fba2afaa
DL
34
35 /*
36 * Pad strcture to 128 bytes. Remember to update the
14e4a0f2 37 * pad size when you add new members. We use a fixed
fba2afaa
DL
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).
43 */
44 __u8 __pad[48];
45};
46
47
48#ifdef __KERNEL__
49
50#ifdef CONFIG_SIGNALFD
51
52/*
b8fceee1 53 * Deliver the signal to listening signalfd.
fba2afaa
DL
54 */
55static inline void signalfd_notify(struct task_struct *tsk, int sig)
56{
b8fceee1
DL
57 if (unlikely(waitqueue_active(&tsk->sighand->signalfd_wqh)))
58 wake_up(&tsk->sighand->signalfd_wqh);
fba2afaa
DL
59}
60
61#else /* CONFIG_SIGNALFD */
62
b8fceee1 63static inline void signalfd_notify(struct task_struct *tsk, int sig) { }
fba2afaa
DL
64
65#endif /* CONFIG_SIGNALFD */
66
67#endif /* __KERNEL__ */
68
69#endif /* _LINUX_SIGNALFD_H */
70