@@ -9,6 +9,8 @@ use crate::slice::from_raw_parts;
9
9
use crate :: sys:: unix:: ext:: net:: addr:: { sockaddr_un, SocketAddr } ;
10
10
use crate :: sys:: unix:: net:: Socket ;
11
11
12
+ use libc:: { gid_t, pid_t, uid_t} ;
13
+
12
14
pub ( super ) fn recv_vectored_with_ancillary_from (
13
15
socket : & Socket ,
14
16
bufs : & mut [ IoSliceMut < ' _ > ] ,
@@ -207,37 +209,37 @@ impl SocketCred {
207
209
208
210
/// Set the PID.
209
211
#[ unstable( feature = "unix_socket_ancillary_data" , issue = "none" ) ]
210
- pub fn set_pid ( & mut self , pid : i32 ) {
212
+ pub fn set_pid ( & mut self , pid : pid_t ) {
211
213
self . 0 . pid = pid;
212
214
}
213
215
214
216
/// Get the current PID.
215
217
#[ unstable( feature = "unix_socket_ancillary_data" , issue = "none" ) ]
216
- pub fn get_pid ( & self ) -> i32 {
218
+ pub fn get_pid ( & self ) -> pid_t {
217
219
self . 0 . pid
218
220
}
219
221
220
222
/// Set the UID.
221
223
#[ unstable( feature = "unix_socket_ancillary_data" , issue = "none" ) ]
222
- pub fn set_uid ( & mut self , uid : u32 ) {
224
+ pub fn set_uid ( & mut self , uid : uid_t ) {
223
225
self . 0 . uid = uid;
224
226
}
225
227
226
228
/// Get the current UID.
227
229
#[ unstable( feature = "unix_socket_ancillary_data" , issue = "none" ) ]
228
- pub fn get_uid ( & self ) -> u32 {
230
+ pub fn get_uid ( & self ) -> uid_t {
229
231
self . 0 . uid
230
232
}
231
233
232
234
/// Set the GID.
233
235
#[ unstable( feature = "unix_socket_ancillary_data" , issue = "none" ) ]
234
- pub fn set_gid ( & mut self , gid : u32 ) {
236
+ pub fn set_gid ( & mut self , gid : gid_t ) {
235
237
self . 0 . gid = gid;
236
238
}
237
239
238
240
/// Get the current GID.
239
241
#[ unstable( feature = "unix_socket_ancillary_data" , issue = "none" ) ]
240
- pub fn get_gid ( & self ) -> u32 {
242
+ pub fn get_gid ( & self ) -> gid_t {
241
243
self . 0 . gid
242
244
}
243
245
}
0 commit comments