@@ -21,9 +21,6 @@ mod libc {
21
21
pub type uid_t = u32 ;
22
22
}
23
23
24
- #[ cfg( any( doc, target_os = "android" , target_os = "linux" , ) ) ]
25
- use libc:: { gid_t, pid_t, uid_t} ;
26
-
27
24
pub ( super ) fn recv_vectored_with_ancillary_from (
28
25
socket : & Socket ,
29
26
bufs : & mut [ IoSliceMut < ' _ > ] ,
@@ -240,37 +237,37 @@ impl SocketCred {
240
237
241
238
/// Set the PID.
242
239
#[ unstable( feature = "unix_socket_ancillary_data" , issue = "76915" ) ]
243
- pub fn set_pid ( & mut self , pid : pid_t ) {
240
+ pub fn set_pid ( & mut self , pid : libc :: pid_t ) {
244
241
self . 0 . pid = pid;
245
242
}
246
243
247
244
/// Get the current PID.
248
245
#[ unstable( feature = "unix_socket_ancillary_data" , issue = "76915" ) ]
249
- pub fn get_pid ( & self ) -> pid_t {
246
+ pub fn get_pid ( & self ) -> libc :: pid_t {
250
247
self . 0 . pid
251
248
}
252
249
253
250
/// Set the UID.
254
251
#[ unstable( feature = "unix_socket_ancillary_data" , issue = "76915" ) ]
255
- pub fn set_uid ( & mut self , uid : uid_t ) {
252
+ pub fn set_uid ( & mut self , uid : libc :: uid_t ) {
256
253
self . 0 . uid = uid;
257
254
}
258
255
259
256
/// Get the current UID.
260
257
#[ unstable( feature = "unix_socket_ancillary_data" , issue = "76915" ) ]
261
- pub fn get_uid ( & self ) -> uid_t {
258
+ pub fn get_uid ( & self ) -> libc :: uid_t {
262
259
self . 0 . uid
263
260
}
264
261
265
262
/// Set the GID.
266
263
#[ unstable( feature = "unix_socket_ancillary_data" , issue = "76915" ) ]
267
- pub fn set_gid ( & mut self , gid : gid_t ) {
264
+ pub fn set_gid ( & mut self , gid : libc :: gid_t ) {
268
265
self . 0 . gid = gid;
269
266
}
270
267
271
268
/// Get the current GID.
272
269
#[ unstable( feature = "unix_socket_ancillary_data" , issue = "76915" ) ]
273
- pub fn get_gid ( & self ) -> gid_t {
270
+ pub fn get_gid ( & self ) -> libc :: gid_t {
274
271
self . 0 . gid
275
272
}
276
273
}
0 commit comments