File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-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
}
Original file line number Diff line number Diff line change @@ -738,6 +738,7 @@ pub const MSG_DONTWAIT: ::c_int = 0x00000080;
738
738
pub const MSG_EOF : :: c_int = 0x00000100 ;
739
739
740
740
pub const SCM_TIMESTAMP : :: c_int = 0x02 ;
741
+ pub const SCM_CREDS : :: c_int = 0x03 ;
741
742
742
743
pub const SOCK_STREAM : :: c_int = 1 ;
743
744
pub const SOCK_DGRAM : :: c_int = 2 ;
You can’t perform that action at this time.
0 commit comments