Skip to content

Commit f26757a

Browse files
committed
Auto merge of #1998 - dylni:make-si-status-method-more-compatible, r=JohnTitor
Make si_status method more compatible Now that [this PR](https://github.com/rust-lang/libc/pull/1858/files) has been merged, `siginfo_t::si_status` is a method for some targets and a field on others. This PR adds the method on targets that already expose the field, which lets the method be used without target detection. I think this change is backward compatible, but it would be better if someone else could confirm that. The struct would now have a method and a field with the same name on some targets. If that's incompatible, another method could be added that accesses the field or calls the method depending on the target, but this is cleaner.
2 parents 80eb0cf + 29b4fae commit f26757a

File tree

4 files changed

+16
-0
lines changed

4 files changed

+16
-0
lines changed

src/unix/bsd/apple/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,10 @@ impl siginfo_t {
690690
pub unsafe fn si_uid(&self) -> ::uid_t {
691691
self.si_uid
692692
}
693+
694+
pub unsafe fn si_status(&self) -> ::c_int {
695+
self.si_status
696+
}
693697
}
694698

695699
cfg_if! {

src/unix/bsd/freebsdlike/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ impl siginfo_t {
7171
pub unsafe fn si_uid(&self) -> ::uid_t {
7272
self.si_uid
7373
}
74+
75+
pub unsafe fn si_status(&self) -> ::c_int {
76+
self.si_status
77+
}
7478
}
7579

7680
s! {

src/unix/haiku/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ impl siginfo_t {
5050
pub unsafe fn si_uid(&self) -> ::uid_t {
5151
self.si_uid
5252
}
53+
54+
pub unsafe fn si_status(&self) -> ::c_int {
55+
self.si_status
56+
}
5357
}
5458

5559
s! {

src/vxworks/mod.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@ impl siginfo_t {
128128
pub unsafe fn si_uid(&self) -> ::uid_t {
129129
self.si_uid
130130
}
131+
132+
pub unsafe fn si_status(&self) -> ::c_int {
133+
self.si_status
134+
}
131135
}
132136

133137
s! {

0 commit comments

Comments
 (0)