File tree 3 files changed +33
-0
lines changed 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -146,5 +146,6 @@ mod imp {
146
146
147
147
pub mod mem {
148
148
pub fn size_of_val < T > ( _: & T ) -> usize { 4 }
149
+ pub fn size_of < T > ( _: & T ) -> usize { 4 }
149
150
}
150
151
}
Original file line number Diff line number Diff line change @@ -159,6 +159,15 @@ s! {
159
159
pub int_p_sign_posn: :: c_char,
160
160
pub int_n_sign_posn: :: c_char,
161
161
}
162
+
163
+ pub struct cmsgcred {
164
+ pub cmcred_pid: :: pid_t,
165
+ pub cmcred_uid: :: uid_t,
166
+ pub cmcred_euid: :: uid_t,
167
+ pub cmcred_gid: :: gid_t,
168
+ pub cmcred_ngroups: :: c_short,
169
+ pub cmcred_groups: [ :: gid_t; CMGROUP_MAX ] ,
170
+ }
162
171
}
163
172
164
173
pub const AIO_LISTIO_MAX : :: c_int = 16 ;
@@ -934,6 +943,8 @@ pub const OCRNL: ::tcflag_t = 0x10;
934
943
pub const ONOCR : :: tcflag_t = 0x20 ;
935
944
pub const ONLRET : :: tcflag_t = 0x40 ;
936
945
946
+ pub const CMGROUP_MAX : usize = 16 ;
947
+
937
948
f ! {
938
949
pub fn WIFCONTINUED ( status: :: c_int) -> bool {
939
950
status == 0x13
Original file line number Diff line number Diff line change
1
+ use dox:: mem;
2
+
1
3
pub type clock_t = :: c_uint ;
2
4
pub type suseconds_t = :: c_int ;
3
5
pub type dev_t = u64 ;
@@ -281,6 +283,16 @@ s! {
281
283
pub ifm_index: :: c_ushort,
282
284
pub ifm_data: if_data,
283
285
}
286
+
287
+ pub struct sockcred {
288
+ pub sc_pid: :: pid_t,
289
+ pub sc_uid: :: uid_t,
290
+ pub sc_euid: :: uid_t,
291
+ pub sc_gid: :: gid_t,
292
+ pub sc_egid: :: gid_t,
293
+ pub sc_ngroups: :: c_int,
294
+ pub sc_groups: [ :: gid_t; 1 ] ,
295
+ }
284
296
}
285
297
286
298
pub const AT_FDCWD : :: c_int = -100 ;
@@ -916,6 +928,15 @@ f! {
916
928
pub fn WIFCONTINUED ( status: :: c_int) -> bool {
917
929
status == 0xffff
918
930
}
931
+
932
+ pub fn SOCKCREDSIZE ( ngrps: usize ) -> usize {
933
+ let ngrps = if ngrps > 0 {
934
+ ngrps - 1
935
+ } else {
936
+ 0
937
+ } ;
938
+ mem:: size_of:: <sockcred>( ) + mem:: size_of:: <:: gid_t>( ) * ngrps
939
+ }
919
940
}
920
941
921
942
extern {
You can’t perform that action at this time.
0 commit comments