Skip to content

Commit eb70b7f

Browse files
committed
Auto merge of #3250 - andrewdavidmackenzie:main, r=JohnTitor
Add ucred struct and field type aliases for redox This PR is redox-os specific and adds the ucred struct and type aliases for its fields into the unix/redox/mod.rs file. This will enable a number of packages (e.g. Tokio) to compile for redox-os using the existing code for linux and other unix-lioke target_os. If this is merged, then follow-up PRs will be made to Tokio and other crates to add "redox" to the list of target_os that said code is enabled for, without adding code to Tokio. Then tokio as-is will build on redox, and no fork or patch will need to be maintained by the redox team. - \[X] `cd libc-test && cargo test` --> Tests pass
2 parents 48d4aec + 8b82c29 commit eb70b7f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/unix/redox/mod.rs

+9
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ pub type suseconds_t = ::c_int;
4848
pub type tcflag_t = u32;
4949
pub type time_t = ::c_longlong;
5050
pub type id_t = ::c_uint;
51+
pub type pid_t = usize;
52+
pub type uid_t = u32;
53+
pub type gid_t = u32;
5154

5255
#[cfg_attr(feature = "extra_traits", derive(Debug))]
5356
pub enum timezone {}
@@ -256,6 +259,12 @@ s! {
256259
pub tm_gmtoff: ::c_long,
257260
pub tm_zone: *const ::c_char,
258261
}
262+
263+
pub struct ucred {
264+
pub pid: pid_t,
265+
pub uid: uid_t,
266+
pub gid: gid_t,
267+
}
259268
}
260269

261270
pub const UTSLENGTH: usize = 65;

0 commit comments

Comments
 (0)