aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/signal.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/signal.h')
-rw-r--r--include/linux/signal.h15
1 files changed, 7 insertions, 8 deletions
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 042968dd98f0..a9bc7e1b077e 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -11,13 +11,14 @@ struct task_struct;
11/* for sysctl */ 11/* for sysctl */
12extern int print_fatal_signals; 12extern int print_fatal_signals;
13 13
14static inline void copy_siginfo(struct siginfo *to, struct siginfo *from) 14static inline void copy_siginfo(struct siginfo *to, const struct siginfo *from)
15{ 15{
16 if (from->si_code < 0) 16 memcpy(to, from, sizeof(*to));
17 memcpy(to, from, sizeof(*to)); 17}
18 else 18
19 /* _sigchld is currently the largest know union member */ 19static inline void clear_siginfo(struct siginfo *info)
20 memcpy(to, from, __ARCH_SI_PREAMBLE_SIZE + sizeof(from->_sifields._sigchld)); 20{
21 memset(info, 0, sizeof(*info));
21} 22}
22 23
23int copy_siginfo_to_user(struct siginfo __user *to, const struct siginfo *from); 24int copy_siginfo_to_user(struct siginfo __user *to, const struct siginfo *from);
@@ -29,9 +30,7 @@ enum siginfo_layout {
29 SIL_FAULT, 30 SIL_FAULT,
30 SIL_CHLD, 31 SIL_CHLD,
31 SIL_RT, 32 SIL_RT,
32#ifdef __ARCH_SIGSYS
33 SIL_SYS, 33 SIL_SYS,
34#endif
35}; 34};
36 35
37enum siginfo_layout siginfo_layout(int sig, int si_code); 36enum siginfo_layout siginfo_layout(int sig, int si_code);