-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch low-hanging fruit semver removals for libc and linux-raw-sys (#…
…1063) * break: Remove low-hanging fruit for linux-raw-sys exposure linux-raw-sys is exposed as a public dependency. This commit removes many of the instances where it is publicly exposed. There are a few places that are more difficult and require greater discussion. I've left these in for now. This is checked using this command: $ cargo public-api --features all-apis | grep -i linux_raw_sys The remaining APIs that expose linux_raw_sys are as follows: pub type rustix::fs::FsWord = linux_raw_sys::general::__fsword_t pub type rustix::fs::RawMode = linux_raw_sys::general::__kernel_mode_t pub type rustix::fs::Stat = linux_raw_sys::general::stat pub type rustix::fs::StatFs = linux_raw_sys::general::statfs64 pub type rustix::fs::Statx = linux_raw_sys::general::statx pub type rustix::fs::StatxTimestamp = linux_raw_sys::general::statx_timestamp pub rustix::io_uring::io_uring_cqe::big_cqe: linux_raw_sys::io_uring::__IncompleteArrayField<u64> pub rustix::io_uring::io_uring_probe::ops: linux_raw_sys::io_uring::__IncompleteArrayField<rustix::io_uring::io_uring_probe_op> pub type rustix::io_uring::Statx = linux_raw_sys::general::statx pub type rustix::net::SocketAddrStorage = linux_raw_sys::net::sockaddr pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &linux_raw_sys::general::siginfo_t pub type rustix::system::Sysinfo = linux_raw_sys::system::sysinfo pub type rustix::termios::Winsize = linux_raw_sys::general::winsize Signed-off-by: John Nunley <[email protected]> * break: Low-hanging fruit for removing libc from public API Similarly to the last commit, this one removes libc types from the public API. Again there are libc types that are harder to remove so I've skipped them for now. This can be checked with: $ cargo public-api --features all-apis,use-libc | grep -i libc The remaining API's are: pub type rustix::fs::Dev = libc::unix::linux_like::linux::dev_t pub type rustix::fs::FsWord = libc::unix::linux_like::linux::gnu::b64::__fsword_t pub type rustix::fs::RawMode = libc::unix::linux_like::linux::mode_t pub type rustix::fs::Stat = libc::unix::linux_like::linux::gnu::b64::x86_64::stat64 pub type rustix::fs::StatFs = libc::unix::linux_like::linux::gnu::b64::x86_64::statfs64 pub type rustix::fs::Statx = libc::unix::linux_like::linux::gnu::statx pub type rustix::fs::StatxTimestamp = libc::unix::linux_like::linux::gnu::statx pub type rustix::io_uring::Statx = libc::unix::linux_like::linux::gnu::statx pub type rustix::net::SocketAddrStorage = libc::unix::linux_like::sockaddr_storage pub const fn rustix::process::WaitidStatus::as_raw(&self) -> &libc::unix::linux_like::linux::gnu::b64::x86_64::siginfo_t pub type rustix::system::Sysinfo = libc::unix::linux_like::linux::gnu::b64::sysinfo pub type rustix::termios::Winsize = libc::unix::winsize Signed-off-by: John Nunley <[email protected]> --------- Signed-off-by: John Nunley <[email protected]>
- Loading branch information
1 parent
c5529aa
commit e9ac49a
Showing
25 changed files
with
95 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub(crate) mod syscalls; | ||
pub(crate) mod types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#[cfg(not(target_os = "redox"))] | ||
use crate::ffi; | ||
|
||
// We don't want to use tcflag_t directly so we don't expose libc | ||
// publicly. Redox uses u32, apple uses c_ulong, everything else | ||
// seems to use c_uint. | ||
|
||
#[cfg(apple)] | ||
pub type tcflag_t = ffi::c_ulong; | ||
#[cfg(target_os = "redox")] | ||
pub type tcflag_t = u32; | ||
#[cfg(not(any(apple, target_os = "redox")))] | ||
pub type tcflag_t = ffi::c_uint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
pub(crate) mod syscalls; | ||
pub(crate) mod types; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#![allow(non_camel_case_types)] | ||
|
||
use crate::ffi; | ||
|
||
// We don't want to use tcflag_t directly so we don't expose linux_raw_sys | ||
// publicly. It appears to be c_ulong on SPARC and c_uint everywhere else. | ||
|
||
#[cfg(target_arch = "sparc")] | ||
pub type tcflag_t = ffi::c_ulong; | ||
#[cfg(not(target_arch = "sparc"))] | ||
pub type tcflag_t = ffi::c_uint; |
Oops, something went wrong.