about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLinkTed <LinkTed@users.noreply.github.com>2020-09-16 20:37:47 +0200
committerLinkTed <LinkTed@users.noreply.github.com>2020-10-10 15:19:12 +0200
commit5964d599ac748ef807594f3dcfc8e69a88449204 (patch)
treee37d53363c4bec93cd23da6da1288abcc849a393
parent1902711f3867753cb2682043c283ffa4a70a317c (diff)
downloadrust-5964d599ac748ef807594f3dcfc8e69a88449204.tar.gz
rust-5964d599ac748ef807594f3dcfc8e69a88449204.zip
Change standard types to libc types
-rw-r--r--library/std/src/sys/unix/ext/net/ancillary.rs14
1 files changed, 8 insertions, 6 deletions
diff --git a/library/std/src/sys/unix/ext/net/ancillary.rs b/library/std/src/sys/unix/ext/net/ancillary.rs
index 8dc74062fdf..d8c2939cd8b 100644
--- a/library/std/src/sys/unix/ext/net/ancillary.rs
+++ b/library/std/src/sys/unix/ext/net/ancillary.rs
@@ -9,6 +9,8 @@ use crate::slice::from_raw_parts;
 use crate::sys::unix::ext::net::addr::{sockaddr_un, SocketAddr};
 use crate::sys::unix::net::Socket;
 
+use libc::{gid_t, pid_t, uid_t};
+
 pub(super) fn recv_vectored_with_ancillary_from(
     socket: &Socket,
     bufs: &mut [IoSliceMut<'_>],
@@ -207,37 +209,37 @@ impl SocketCred {
 
     /// Set the PID.
     #[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
-    pub fn set_pid(&mut self, pid: i32) {
+    pub fn set_pid(&mut self, pid: pid_t) {
         self.0.pid = pid;
     }
 
     /// Get the current PID.
     #[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
-    pub fn get_pid(&self) -> i32 {
+    pub fn get_pid(&self) -> pid_t {
         self.0.pid
     }
 
     /// Set the UID.
     #[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
-    pub fn set_uid(&mut self, uid: u32) {
+    pub fn set_uid(&mut self, uid: uid_t) {
         self.0.uid = uid;
     }
 
     /// Get the current UID.
     #[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
-    pub fn get_uid(&self) -> u32 {
+    pub fn get_uid(&self) -> uid_t {
         self.0.uid
     }
 
     /// Set the GID.
     #[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
-    pub fn set_gid(&mut self, gid: u32) {
+    pub fn set_gid(&mut self, gid: gid_t) {
         self.0.gid = gid;
     }
 
     /// Get the current GID.
     #[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
-    pub fn get_gid(&self) -> u32 {
+    pub fn get_gid(&self) -> gid_t {
         self.0.gid
     }
 }