Skip to content

Commit 5964d59

Browse files
committed
Change standard types to libc types
1 parent 1902711 commit 5964d59

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

library/std/src/sys/unix/ext/net/ancillary.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ use crate::slice::from_raw_parts;
99
use crate::sys::unix::ext::net::addr::{sockaddr_un, SocketAddr};
1010
use crate::sys::unix::net::Socket;
1111

12+
use libc::{gid_t, pid_t, uid_t};
13+
1214
pub(super) fn recv_vectored_with_ancillary_from(
1315
socket: &Socket,
1416
bufs: &mut [IoSliceMut<'_>],
@@ -207,37 +209,37 @@ impl SocketCred {
207209

208210
/// Set the PID.
209211
#[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) {
211213
self.0.pid = pid;
212214
}
213215

214216
/// Get the current PID.
215217
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
216-
pub fn get_pid(&self) -> i32 {
218+
pub fn get_pid(&self) -> pid_t {
217219
self.0.pid
218220
}
219221

220222
/// Set the UID.
221223
#[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) {
223225
self.0.uid = uid;
224226
}
225227

226228
/// Get the current UID.
227229
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
228-
pub fn get_uid(&self) -> u32 {
230+
pub fn get_uid(&self) -> uid_t {
229231
self.0.uid
230232
}
231233

232234
/// Set the GID.
233235
#[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) {
235237
self.0.gid = gid;
236238
}
237239

238240
/// Get the current GID.
239241
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
240-
pub fn get_gid(&self) -> u32 {
242+
pub fn get_gid(&self) -> gid_t {
241243
self.0.gid
242244
}
243245
}

0 commit comments

Comments
 (0)