@@ -21,9 +21,6 @@ mod libc {
2121 pub type uid_t = u32 ;
2222}
2323
24- #[ cfg( any( doc, target_os = "android" , target_os = "linux" , ) ) ]
25- use libc:: { gid_t, pid_t, uid_t} ;
26-
2724pub ( super ) fn recv_vectored_with_ancillary_from (
2825 socket : & Socket ,
2926 bufs : & mut [ IoSliceMut < ' _ > ] ,
@@ -240,37 +237,37 @@ impl SocketCred {
240237
241238 /// Set the PID.
242239 #[ 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 ) {
244241 self . 0 . pid = pid;
245242 }
246243
247244 /// Get the current PID.
248245 #[ 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 {
250247 self . 0 . pid
251248 }
252249
253250 /// Set the UID.
254251 #[ 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 ) {
256253 self . 0 . uid = uid;
257254 }
258255
259256 /// Get the current UID.
260257 #[ 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 {
262259 self . 0 . uid
263260 }
264261
265262 /// Set the GID.
266263 #[ 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 ) {
268265 self . 0 . gid = gid;
269266 }
270267
271268 /// Get the current GID.
272269 #[ 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 {
274271 self . 0 . gid
275272 }
276273}
0 commit comments