File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
src/unix/bsd/freebsdlike/freebsd Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,15 @@ s! {
107
107
pub msg_hdr: :: msghdr,
108
108
pub msg_len: :: ssize_t,
109
109
}
110
+
111
+ pub struct sockcred {
112
+ pub sc_uid: :: uid_t,
113
+ pub sc_euid: :: uid_t,
114
+ pub sc_gid: :: gid_t,
115
+ pub sc_egid: :: gid_t,
116
+ pub sc_ngroups: :: c_int,
117
+ pub sc_groups: [ :: gid_t; 1 ] ,
118
+ }
110
119
}
111
120
112
121
s_no_extra_traits ! {
@@ -1136,6 +1145,15 @@ f! {
1136
1145
as :: c_uint
1137
1146
}
1138
1147
1148
+ pub fn SOCKCREDSIZE ( ngrps: usize ) -> usize {
1149
+ let ngrps = if ngrps > 0 {
1150
+ ngrps - 1
1151
+ } else {
1152
+ 0
1153
+ } ;
1154
+ :: mem:: size_of:: <sockcred>( ) + :: mem:: size_of:: <:: gid_t>( ) * ngrps
1155
+ }
1156
+
1139
1157
pub fn uname( buf: * mut :: utsname) -> :: c_int {
1140
1158
__xuname( 256 , buf as * mut :: c_void)
1141
1159
}
You can’t perform that action at this time.
0 commit comments