about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLinkTed <LinkTed@users.noreply.github.com>2020-10-05 21:26:23 +0200
committerLinkTed <LinkTed@users.noreply.github.com>2020-10-10 15:19:13 +0200
commit7b596f2e1330403ebb69c0c5ea8bd8a4eab256a0 (patch)
treede04d16718afd470ee19d13c28fa090e9d07bc93
parentfc65f6a0ce74a2d325a04f1b87edfa5ecbfa6ccd (diff)
downloadrust-7b596f2e1330403ebb69c0c5ea8bd8a4eab256a0.tar.gz
rust-7b596f2e1330403ebb69c0c5ea8bd8a4eab256a0.zip
Fix `libc` is ambiguous for Windows
-rw-r--r--library/std/src/sys/unix/ext/net/ancillary.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/library/std/src/sys/unix/ext/net/ancillary.rs b/library/std/src/sys/unix/ext/net/ancillary.rs
index e1d0fe125cc..9442d340a32 100644
--- a/library/std/src/sys/unix/ext/net/ancillary.rs
+++ b/library/std/src/sys/unix/ext/net/ancillary.rs
@@ -21,9 +21,6 @@ mod libc {
     pub type uid_t = u32;
 }
 
-#[cfg(any(doc, target_os = "android", target_os = "linux",))]
-use libc::{gid_t, pid_t, uid_t};
-
 pub(super) fn recv_vectored_with_ancillary_from(
     socket: &Socket,
     bufs: &mut [IoSliceMut<'_>],
@@ -240,37 +237,37 @@ impl SocketCred {
 
     /// Set the PID.
     #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
-    pub fn set_pid(&mut self, pid: pid_t) {
+    pub fn set_pid(&mut self, pid: libc::pid_t) {
         self.0.pid = pid;
     }
 
     /// Get the current PID.
     #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
-    pub fn get_pid(&self) -> pid_t {
+    pub fn get_pid(&self) -> libc::pid_t {
         self.0.pid
     }
 
     /// Set the UID.
     #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
-    pub fn set_uid(&mut self, uid: uid_t) {
+    pub fn set_uid(&mut self, uid: libc::uid_t) {
         self.0.uid = uid;
     }
 
     /// Get the current UID.
     #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
-    pub fn get_uid(&self) -> uid_t {
+    pub fn get_uid(&self) -> libc::uid_t {
         self.0.uid
     }
 
     /// Set the GID.
     #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
-    pub fn set_gid(&mut self, gid: gid_t) {
+    pub fn set_gid(&mut self, gid: libc::gid_t) {
         self.0.gid = gid;
     }
 
     /// Get the current GID.
     #[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
-    pub fn get_gid(&self) -> gid_t {
+    pub fn get_gid(&self) -> libc::gid_t {
         self.0.gid
     }
 }