History

signal: Move addr_lsb into the _sigfault union for clarity

The addr_lsb fields is only valid and available when the signal is SIGBUS and the si_code is BUS_MCEERR_AR or BUS_MCEERR_AO. Document this with a comment and place the field in the _sigfault union to make this clear. All of the fields stay in the same physical location so both the old and new definitions of struct siginfo will continue to work.

Eric W. Biederman committed 9 years ago

Commit b68a68d1 parent b713da62 files · +21 −5Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/asm-generic/siginfo.h+11−3
@@ -94,15 +94,23 @@ typedef struct siginfo { · 93 unmodified lines
94 unsigned int _flags; /* see ia64 si_flags */94 unsigned int _flags; /* see ia64 si_flags */
95 unsigned long _isr; /* isr */95 unsigned long _isr; /* isr */
96#endif96#endif
97 short _addr_lsb; /* LSB of the reported address */
98 union {97 union {
98 /*
99 * used when si_code=BUS_MCEERR_AR or
100 * used when si_code=BUS_MCEERR_AO
101 */
102 short _addr_lsb; /* LSB of the reported address */
99 /* used when si_code=SEGV_BNDERR */103 /* used when si_code=SEGV_BNDERR */
100 struct {104 struct {
105 short _dummy_bnd;
101 void __user *_lower;106 void __user *_lower;
102 void __user *_upper;107 void __user *_upper;
103 } _addr_bnd;108 } _addr_bnd;
104 /* used when si_code=SEGV_PKUERR */109 /* used when si_code=SEGV_PKUERR */
105 __u32 _pkey;110 struct {
111 short _dummy_pkey;
112 __u32 _pkey;
113 } _addr_pkey;
106 };114 };
107 } _sigfault;115 } _sigfault;
108 116
@@ -142,7 +150,7 @@ typedef struct siginfo { · 33 unmodified lines
142#define si_addr_lsb _sifields._sigfault._addr_lsb150#define si_addr_lsb _sifields._sigfault._addr_lsb
143#define si_lower _sifields._sigfault._addr_bnd._lower151#define si_lower _sifields._sigfault._addr_bnd._lower
144#define si_upper _sifields._sigfault._addr_bnd._upper152#define si_upper _sifields._sigfault._addr_bnd._upper
145#define si_pkey _sifields._sigfault._pkey153#define si_pkey _sifields._sigfault._addr_pkey._pkey
146#define si_band _sifields._sigpoll._band154#define si_band _sifields._sigpoll._band
147#define si_fd _sifields._sigpoll._fd155#define si_fd _sifields._sigpoll._fd
148#define si_call_addr _sifields._sigsys._call_addr156#define si_call_addr _sifields._sigsys._call_addr

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t