Update to rustix 0.26.2. (#3521)
This pulls in a fix for Android, where Android's seccomp policy on older versions is to make `openat2` irrecoverably crash the process, so we have to do a version check up front rather than relying on `ENOSYS` to determine if `openat2` is supported. And it pulls in the fix for the link errors when multiple versions of rsix/rustix are linked in. And it has updates for two crate renamings: rsix has been renamed to rustix, and unsafe-io has been renamed to io-extras.
This commit is contained in:
@@ -47,7 +47,7 @@ impl FiberStack {
|
||||
pub fn new(size: usize) -> io::Result<Self> {
|
||||
// Round up our stack size request to the nearest multiple of the
|
||||
// page size.
|
||||
let page_size = rsix::process::page_size();
|
||||
let page_size = rustix::process::page_size();
|
||||
let size = if size == 0 {
|
||||
page_size
|
||||
} else {
|
||||
@@ -57,17 +57,17 @@ impl FiberStack {
|
||||
unsafe {
|
||||
// Add in one page for a guard page and then ask for some memory.
|
||||
let mmap_len = size + page_size;
|
||||
let mmap = rsix::io::mmap_anonymous(
|
||||
let mmap = rustix::io::mmap_anonymous(
|
||||
ptr::null_mut(),
|
||||
mmap_len,
|
||||
rsix::io::ProtFlags::empty(),
|
||||
rsix::io::MapFlags::PRIVATE,
|
||||
rustix::io::ProtFlags::empty(),
|
||||
rustix::io::MapFlags::PRIVATE,
|
||||
)?;
|
||||
|
||||
rsix::io::mprotect(
|
||||
rustix::io::mprotect(
|
||||
mmap.cast::<u8>().add(page_size).cast(),
|
||||
size,
|
||||
rsix::io::MprotectFlags::READ | rsix::io::MprotectFlags::WRITE,
|
||||
rustix::io::MprotectFlags::READ | rustix::io::MprotectFlags::WRITE,
|
||||
)?;
|
||||
|
||||
Ok(Self {
|
||||
@@ -90,7 +90,7 @@ impl Drop for FiberStack {
|
||||
fn drop(&mut self) {
|
||||
unsafe {
|
||||
if let Some(len) = self.len {
|
||||
let ret = rsix::io::munmap(self.top.sub(len) as _, len);
|
||||
let ret = rustix::io::munmap(self.top.sub(len) as _, len);
|
||||
debug_assert!(ret.is_ok());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user