Skip to content

Commit

Permalink
Auto merge of #3250 - andrewdavidmackenzie:main, r=JohnTitor
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bors committed May 24, 2023
2 parents 48d4aec + 8b82c29 commit eb70b7f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/unix/redox/mod.rs
Expand Up @@ -48,6 +48,9 @@ pub type suseconds_t = ::c_int;
pub type tcflag_t = u32;
pub type time_t = ::c_longlong;
pub type id_t = ::c_uint;
pub type pid_t = usize;
pub type uid_t = u32;
pub type gid_t = u32;

#[cfg_attr(feature = "extra_traits", derive(Debug))]
pub enum timezone {}
Expand Down Expand Up @@ -256,6 +259,12 @@ s! {
pub tm_gmtoff: ::c_long,
pub tm_zone: *const ::c_char,
}

pub struct ucred {
pub pid: pid_t,
pub uid: uid_t,
pub gid: gid_t,
}
}

pub const UTSLENGTH: usize = 65;
Expand Down

0 comments on commit eb70b7f

Please sign in to comment.