std: fix module references on UNIX

This commit is contained in:
joboet 2024-01-11 20:26:06 +01:00
parent cac470cde1
commit 411f34b782
No known key found for this signature in database
GPG Key ID: 704E0149B0194B3C
6 changed files with 8 additions and 8 deletions

View File

@ -2008,7 +2008,7 @@ mod remove_dir_impl {
pub unsafe fn openat(dirfd: c_int, pathname: *const c_char, flags: c_int) -> c_int {
get_openat_fn().map(|openat| openat(dirfd, pathname, flags)).unwrap_or_else(|| {
crate::sys::unix::os::set_errno(libc::ENOSYS);
crate::sys::pal::unix::os::set_errno(libc::ENOSYS);
-1
})
}
@ -2019,7 +2019,7 @@ mod remove_dir_impl {
#[cfg(all(target_os = "macos", target_arch = "x86_64"))]
weak!(fn fdopendir(c_int) -> *mut DIR, "fdopendir$INODE64");
fdopendir.get().map(|fdopendir| fdopendir(fd)).unwrap_or_else(|| {
crate::sys::unix::os::set_errno(libc::ENOSYS);
crate::sys::pal::unix::os::set_errno(libc::ENOSYS);
crate::ptr::null_mut()
})
}
@ -2027,7 +2027,7 @@ mod remove_dir_impl {
pub unsafe fn unlinkat(dirfd: c_int, pathname: *const c_char, flags: c_int) -> c_int {
weak!(fn unlinkat(c_int, *const c_char, c_int) -> c_int);
unlinkat.get().map(|unlinkat| unlinkat(dirfd, pathname, flags)).unwrap_or_else(|| {
crate::sys::unix::os::set_errno(libc::ENOSYS);
crate::sys::pal::unix::os::set_errno(libc::ENOSYS);
-1
})
}

View File

@ -6,7 +6,7 @@ use crate::net::{Shutdown, SocketAddr};
use crate::os::unix::io::{AsFd, AsRawFd, BorrowedFd, FromRawFd, IntoRawFd, RawFd};
use crate::str;
use crate::sys::fd::FileDesc;
use crate::sys::unix::IsMinusOne;
use crate::sys::pal::unix::IsMinusOne;
use crate::sys_common::net::{getsockopt, setsockopt, sockaddr_to_addr};
use crate::sys_common::{AsInner, FromInner, IntoInner};
use crate::time::{Duration, Instant};

View File

@ -63,7 +63,7 @@ cfg_if::cfg_if! {
let bit = (signum - 1) as usize;
if set.is_null() || bit >= (8 * size_of::<sigset_t>()) {
crate::sys::unix::os::set_errno(libc::EINVAL);
crate::sys::pal::unix::os::set_errno(libc::EINVAL);
return -1;
}
let raw = slice::from_raw_parts_mut(

View File

@ -362,7 +362,7 @@ impl Command {
// If #[unix_sigpipe] is not specified, reset SIGPIPE to SIG_DFL for backward compatibility.
//
// #[unix_sigpipe] is an opportunity to change the default here.
if !crate::sys::unix_sigpipe_attr_specified() {
if !crate::sys::pal::unix_sigpipe_attr_specified() {
#[cfg(target_os = "android")] // see issue #88585
{
let mut action: libc::sigaction = mem::zeroed();

View File

@ -1,8 +1,8 @@
use crate::fmt;
use crate::io;
use crate::num::NonZeroI32;
use crate::sys::pal::unix::unsupported::*;
use crate::sys::process::process_common::*;
use crate::sys::unix::unsupported::*;
use core::ffi::NonZero_c_int;
use libc::{c_int, pid_t};

View File

@ -55,7 +55,7 @@ mod imp {
use libc::{MAP_ANON, MAP_PRIVATE, PROT_NONE, PROT_READ, PROT_WRITE, SIGSEGV};
use crate::sync::atomic::{AtomicBool, AtomicPtr, Ordering};
use crate::sys::unix::os::page_size;
use crate::sys::pal::unix::os::page_size;
use crate::sys_common::thread_info;
// Signal handler for the SIGSEGV and SIGBUS handlers. We've got guard pages