1 //===-- generate_siginfo_linux.c ------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
16 printf(" {\"%s\", %zd, %zd},\n", #member, \
17 offsetof(siginfo_t, member), sizeof(siginfo.member));
19 // undef annoying "POSIX friendliness" macros
32 printf(" ExpectFields(siginfo_type,\n");
35 #if !defined(__NetBSD__)
40 #if defined(__GLIBC__)
41 P(_sifields
._kill
.si_pid
);
42 P(_sifields
._kill
.si_uid
);
43 P(_sifields
._timer
.si_tid
);
44 P(_sifields
._timer
.si_overrun
);
45 P(_sifields
._timer
.si_sigval
);
46 P(_sifields
._rt
.si_pid
);
47 P(_sifields
._rt
.si_uid
);
48 P(_sifields
._rt
.si_sigval
);
49 P(_sifields
._sigchld
.si_pid
);
50 P(_sifields
._sigchld
.si_uid
);
51 P(_sifields
._sigchld
.si_status
);
52 P(_sifields
._sigchld
.si_utime
);
53 P(_sifields
._sigchld
.si_stime
);
54 P(_sifields
._sigfault
.si_addr
);
55 P(_sifields
._sigfault
.si_addr_lsb
);
56 P(_sifields
._sigfault
._bounds
._addr_bnd
._lower
);
57 P(_sifields
._sigfault
._bounds
._addr_bnd
._upper
);
58 P(_sifields
._sigfault
._bounds
._pkey
);
59 P(_sifields
._sigpoll
.si_band
);
60 P(_sifields
._sigpoll
.si_fd
);
61 P(_sifields
._sigsys
._call_addr
);
62 P(_sifields
._sigsys
._syscall
);
63 P(_sifields
._sigsys
._arch
);
64 #endif // defined(__GLIBC__)
66 #if defined(__FreeBSD__)
67 // these are top-level fields on FreeBSD
73 P(_reason
._fault
._trapno
);
74 P(_reason
._timer
._timerid
);
75 P(_reason
._timer
._overrun
);
76 P(_reason
._mesgq
._mqd
);
77 P(_reason
._poll
._band
);
78 #endif // defined(__FreeBSD__)
80 #else // defined(__NetBSD__)
85 P(_info
._reason
._rt
._pid
);
86 P(_info
._reason
._rt
._uid
);
87 P(_info
._reason
._rt
._value
);
88 P(_info
._reason
._child
._pid
);
89 P(_info
._reason
._child
._uid
);
90 P(_info
._reason
._child
._status
);
91 P(_info
._reason
._child
._utime
);
92 P(_info
._reason
._child
._stime
);
93 P(_info
._reason
._fault
._addr
);
94 P(_info
._reason
._fault
._trap
);
95 P(_info
._reason
._fault
._trap2
);
96 P(_info
._reason
._fault
._trap3
);
97 P(_info
._reason
._poll
._band
);
98 P(_info
._reason
._poll
._fd
);
99 P(_info
._reason
._syscall
._sysnum
);
100 P(_info
._reason
._syscall
._retval
);
101 P(_info
._reason
._syscall
._error
);
102 P(_info
._reason
._syscall
._args
);
103 P(_info
._reason
._ptrace_state
._pe_report_event
);
104 P(_info
._reason
._ptrace_state
._option
._pe_other_pid
);
105 P(_info
._reason
._ptrace_state
._option
._pe_lwp
);
107 #endif // defined(__NetBSD__)