File tree 5 files changed +72
-0
lines changed
5 files changed +72
-0
lines changed Original file line number Diff line number Diff line change @@ -680,6 +680,14 @@ impl siginfo_t {
680
680
681
681
( * ( self as * const siginfo_t as * const siginfo_timer ) ) . si_value
682
682
}
683
+
684
+ pub unsafe fn si_pid ( & self ) -> :: pid_t {
685
+ self . si_pid
686
+ }
687
+
688
+ pub unsafe fn si_uid ( & self ) -> :: uid_t {
689
+ self . si_uid
690
+ }
683
691
}
684
692
685
693
cfg_if ! {
Original file line number Diff line number Diff line change @@ -31,6 +31,14 @@ impl siginfo_t {
31
31
pub unsafe fn si_value ( & self ) -> :: sigval {
32
32
self . si_value
33
33
}
34
+
35
+ pub unsafe fn si_pid ( & self ) -> :: pid_t {
36
+ self . si_pid
37
+ }
38
+
39
+ pub unsafe fn si_uid ( & self ) -> :: uid_t {
40
+ self . si_uid
41
+ }
34
42
}
35
43
36
44
s ! {
Original file line number Diff line number Diff line change @@ -38,6 +38,20 @@ impl ::Clone for timezone {
38
38
}
39
39
}
40
40
41
+ impl siginfo_t {
42
+ pub unsafe fn si_addr ( & self ) -> * mut :: c_void {
43
+ self . si_addr
44
+ }
45
+
46
+ pub unsafe fn si_pid ( & self ) -> :: pid_t {
47
+ self . si_pid
48
+ }
49
+
50
+ pub unsafe fn si_uid ( & self ) -> :: uid_t {
51
+ self . si_uid
52
+ }
53
+ }
54
+
41
55
s ! {
42
56
pub struct in_addr {
43
57
pub s_addr: :: in_addr_t,
Original file line number Diff line number Diff line change @@ -287,6 +287,18 @@ s! {
287
287
}
288
288
}
289
289
290
+ // For internal casts to access union fields
291
+ #[ repr( C ) ]
292
+ struct siginfo_sigchld {
293
+ _si_signo : :: c_int ,
294
+ _si_errno : :: c_int ,
295
+ _si_code : :: c_int ,
296
+ _pad : :: c_int ,
297
+ si_pid : :: pid_t ,
298
+ si_uid : :: uid_t ,
299
+ si_status : :: c_int ,
300
+ }
301
+
290
302
impl siginfo_t {
291
303
pub unsafe fn si_addr ( & self ) -> * mut :: c_void {
292
304
#[ repr( C ) ]
@@ -311,6 +323,18 @@ impl siginfo_t {
311
323
}
312
324
( * ( self as * const siginfo_t as * const siginfo_timer ) ) . si_sigval
313
325
}
326
+
327
+ pub unsafe fn si_pid ( & self ) -> :: pid_t {
328
+ ( * ( self as * const siginfo_t as * const siginfo_sigchld ) ) . si_pid
329
+ }
330
+
331
+ pub unsafe fn si_uid ( & self ) -> :: uid_t {
332
+ ( * ( self as * const siginfo_t as * const siginfo_sigchld ) ) . si_uid
333
+ }
334
+
335
+ pub unsafe fn si_status ( & self ) -> :: c_int {
336
+ ( * ( self as * const siginfo_t as * const siginfo_sigchld ) ) . si_status
337
+ }
314
338
}
315
339
316
340
s_no_extra_traits ! {
Original file line number Diff line number Diff line change @@ -112,6 +112,24 @@ impl ::Clone for _Vx_semaphore {
112
112
}
113
113
}
114
114
115
+ impl siginfo_t {
116
+ pub unsafe fn si_addr ( & self ) -> * mut :: c_void {
117
+ self . si_addr
118
+ }
119
+
120
+ pub unsafe fn si_value ( & self ) -> :: sigval {
121
+ self . si_value
122
+ }
123
+
124
+ pub unsafe fn si_pid ( & self ) -> :: pid_t {
125
+ self . si_pid
126
+ }
127
+
128
+ pub unsafe fn si_uid ( & self ) -> :: uid_t {
129
+ self . si_uid
130
+ }
131
+ }
132
+
115
133
s ! {
116
134
// b_pthread_condattr_t.h
117
135
pub struct pthread_condattr_t {
You can’t perform that action at this time.
0 commit comments