diff options
Diffstat (limited to 'library/std/src/sys')
| -rw-r--r-- | library/std/src/sys/pal/unix/args.rs | 15 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/env.rs | 11 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/fd.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/fs.rs | 38 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/mod.rs | 3 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/os.rs | 13 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/process/process_unix.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/rand.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/thread.rs | 9 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/thread_local_dtor.rs | 8 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/thread_parking/mod.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/thread_parking/pthread.rs | 3 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/time.rs | 5 | ||||
| -rw-r--r-- | library/std/src/sys/personality/gcc.rs | 2 | ||||
| -rw-r--r-- | library/std/src/sys/sync/condvar/pthread.rs | 3 |
15 files changed, 102 insertions, 13 deletions
diff --git a/library/std/src/sys/pal/unix/args.rs b/library/std/src/sys/pal/unix/args.rs index 78e82d9c194..acf8100d47f 100644 --- a/library/std/src/sys/pal/unix/args.rs +++ b/library/std/src/sys/pal/unix/args.rs @@ -170,7 +170,13 @@ mod imp { } } -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "watchos", + target_os = "visionos", + target_os = "tvos" +))] mod imp { use super::Args; use crate::ffi::CStr; @@ -211,7 +217,12 @@ mod imp { // for i in (0..[args count]) // res.push([args objectAtIndex:i]) // res - #[cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos"))] + #[cfg(any( + target_os = "ios", + target_os = "tvos", + target_os = "watchos", + target_os = "visionos" + ))] pub fn args() -> Args { use crate::ffi::{c_char, c_void, OsString}; use crate::mem; diff --git a/library/std/src/sys/pal/unix/env.rs b/library/std/src/sys/pal/unix/env.rs index 3d4ba509829..fb1f868644d 100644 --- a/library/std/src/sys/pal/unix/env.rs +++ b/library/std/src/sys/pal/unix/env.rs @@ -53,6 +53,17 @@ pub mod os { pub const EXE_EXTENSION: &str = ""; } +#[cfg(target_os = "visionos")] +pub mod os { + pub const FAMILY: &str = "unix"; + pub const OS: &str = "visionos"; + pub const DLL_PREFIX: &str = "lib"; + pub const DLL_SUFFIX: &str = ".dylib"; + pub const DLL_EXTENSION: &str = "dylib"; + pub const EXE_SUFFIX: &str = ""; + pub const EXE_EXTENSION: &str = ""; +} + #[cfg(target_os = "freebsd")] pub mod os { pub const FAMILY: &str = "unix"; diff --git a/library/std/src/sys/pal/unix/fd.rs b/library/std/src/sys/pal/unix/fd.rs index a1c0321876f..d6a57f179e5 100644 --- a/library/std/src/sys/pal/unix/fd.rs +++ b/library/std/src/sys/pal/unix/fd.rs @@ -51,6 +51,7 @@ const READ_LIMIT: usize = libc::ssize_t::MAX as usize; target_os = "netbsd", target_os = "openbsd", target_os = "watchos", + target_os = "visionos", ))] const fn max_iov() -> usize { libc::IOV_MAX as usize @@ -81,6 +82,7 @@ const fn max_iov() -> usize { target_os = "horizon", target_os = "vita", target_os = "watchos", + target_os = "visionos", )))] const fn max_iov() -> usize { 16 // The minimum value required by POSIX. diff --git a/library/std/src/sys/pal/unix/fs.rs b/library/std/src/sys/pal/unix/fs.rs index b968f8df34c..4d93a9b3933 100644 --- a/library/std/src/sys/pal/unix/fs.rs +++ b/library/std/src/sys/pal/unix/fs.rs @@ -23,6 +23,7 @@ use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner}; target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", ))] use crate::sys::weak::syscall; #[cfg(any(target_os = "android", target_os = "macos", target_os = "solaris"))] @@ -35,6 +36,7 @@ use libc::{c_int, mode_t}; target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "solaris", all(target_os = "linux", target_env = "gnu") ))] @@ -377,7 +379,13 @@ pub struct FilePermissions { pub struct FileTimes { accessed: Option<SystemTime>, modified: Option<SystemTime>, - #[cfg(any(target_os = "macos", target_os = "ios", target_os = "watchos", target_os = "tvos"))] + #[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "watchos", + target_os = "visionos", + target_os = "tvos" + ))] created: Option<SystemTime>, } @@ -555,6 +563,7 @@ impl FileAttr { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", ))] pub fn created(&self) -> io::Result<SystemTime> { SystemTime::new(self.stat.st_birthtime as i64, self.stat.st_birthtime_nsec as i64) @@ -567,6 +576,7 @@ impl FileAttr { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "vita", )))] pub fn created(&self) -> io::Result<SystemTime> { @@ -647,7 +657,13 @@ impl FileTimes { self.modified = Some(t); } - #[cfg(any(target_os = "macos", target_os = "ios", target_os = "watchos", target_os = "tvos"))] + #[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "watchos", + target_os = "visionos", + target_os = "tvos" + ))] pub fn set_created(&mut self, t: SystemTime) { self.created = Some(t); } @@ -938,6 +954,7 @@ impl DirEntry { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "linux", target_os = "emscripten", target_os = "android", @@ -974,6 +991,7 @@ impl DirEntry { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "netbsd", target_os = "openbsd", target_os = "freebsd", @@ -993,6 +1011,7 @@ impl DirEntry { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "netbsd", target_os = "openbsd", target_os = "freebsd", @@ -1162,6 +1181,7 @@ impl File { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", ))] unsafe fn os_fsync(fd: c_int) -> c_int { libc::fcntl(fd, libc::F_FULLFSYNC) @@ -1171,6 +1191,7 @@ impl File { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", )))] unsafe fn os_fsync(fd: c_int) -> c_int { libc::fsync(fd) @@ -1186,6 +1207,7 @@ impl File { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", ))] unsafe fn os_datasync(fd: c_int) -> c_int { libc::fcntl(fd, libc::F_FULLFSYNC) @@ -1212,6 +1234,7 @@ impl File { target_os = "netbsd", target_os = "openbsd", target_os = "watchos", + target_os = "visionos", target_os = "nto", target_os = "hurd", )))] @@ -1322,7 +1345,7 @@ impl File { io::ErrorKind::Unsupported, "setting file times not supported", )) - } else if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] { + } else if #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))] { let mut buf = [mem::MaybeUninit::<libc::timespec>::uninit(); 3]; let mut num_times = 0; let mut attrlist: libc::attrlist = unsafe { mem::zeroed() }; @@ -1787,6 +1810,7 @@ fn open_to_and_set_permissions( target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", )))] pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { let (mut reader, reader_metadata) = open_from(from)?; @@ -1813,7 +1837,13 @@ pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { } } -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "watchos", + target_os = "visionos", + target_os = "tvos" +))] pub fn copy(from: &Path, to: &Path) -> io::Result<u64> { use crate::sync::atomic::{AtomicBool, Ordering}; diff --git a/library/std/src/sys/pal/unix/mod.rs b/library/std/src/sys/pal/unix/mod.rs index f608ae47a21..4ae76518c4f 100644 --- a/library/std/src/sys/pal/unix/mod.rs +++ b/library/std/src/sys/pal/unix/mod.rs @@ -83,6 +83,7 @@ pub unsafe fn init(argc: isize, argv: *const *const u8, sigpipe: u8) { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "redox", target_os = "l4re", target_os = "horizon", @@ -405,7 +406,7 @@ cfg_if::cfg_if! { } else if #[cfg(target_os = "macos")] { #[link(name = "System")] extern "C" {} - } else if #[cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos"))] { + } else if #[cfg(any(target_os = "ios", target_os = "tvos", target_os = "watchos", target_os = "visionos"))] { #[link(name = "System")] #[link(name = "objc")] #[link(name = "Foundation", kind = "framework")] diff --git a/library/std/src/sys/pal/unix/os.rs b/library/std/src/sys/pal/unix/os.rs index 0b9c8027e6f..96492fedece 100644 --- a/library/std/src/sys/pal/unix/os.rs +++ b/library/std/src/sys/pal/unix/os.rs @@ -69,7 +69,8 @@ extern "C" { target_os = "ios", target_os = "tvos", target_os = "freebsd", - target_os = "watchos" + target_os = "watchos", + target_os = "visionos", ), link_name = "__error" )] @@ -430,7 +431,13 @@ pub fn current_exe() -> io::Result<PathBuf> { Ok(PathBuf::from(OsString::from_vec(e))) } -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "watchos", + target_os = "visionos", + target_os = "tvos" +))] pub fn current_exe() -> io::Result<PathBuf> { unsafe { let mut sz: u32 = 0; @@ -699,6 +706,7 @@ pub fn home_dir() -> Option<PathBuf> { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "emscripten", target_os = "redox", target_os = "vxworks", @@ -714,6 +722,7 @@ pub fn home_dir() -> Option<PathBuf> { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "emscripten", target_os = "redox", target_os = "vxworks", diff --git a/library/std/src/sys/pal/unix/process/process_unix.rs b/library/std/src/sys/pal/unix/process/process_unix.rs index f017d39d804..e798510f9e6 100644 --- a/library/std/src/sys/pal/unix/process/process_unix.rs +++ b/library/std/src/sys/pal/unix/process/process_unix.rs @@ -14,6 +14,7 @@ use crate::os::unix::io::AsRawFd; #[cfg(any( target_os = "macos", target_os = "watchos", + target_os = "visionos", target_os = "tvos", target_os = "freebsd", all(target_os = "linux", target_env = "gnu"), diff --git a/library/std/src/sys/pal/unix/rand.rs b/library/std/src/sys/pal/unix/rand.rs index c9ed6825f6c..d88acf065b0 100644 --- a/library/std/src/sys/pal/unix/rand.rs +++ b/library/std/src/sys/pal/unix/rand.rs @@ -16,6 +16,7 @@ pub fn hashmap_random_keys() -> (u64, u64) { not(target_os = "ios"), not(target_os = "tvos"), not(target_os = "watchos"), + not(target_os = "visionos"), not(target_os = "openbsd"), not(target_os = "netbsd"), not(target_os = "fuchsia"), diff --git a/library/std/src/sys/pal/unix/thread.rs b/library/std/src/sys/pal/unix/thread.rs index 6520ca9fc48..77b54a4a40f 100644 --- a/library/std/src/sys/pal/unix/thread.rs +++ b/library/std/src/sys/pal/unix/thread.rs @@ -150,7 +150,13 @@ impl Thread { } } - #[cfg(any(target_os = "macos", target_os = "ios", target_os = "tvos", target_os = "watchos"))] + #[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "watchos", + target_os = "visionos", + target_os = "tvos" + ))] pub fn set_name(name: &CStr) { unsafe { let name = truncate_cstr::<{ libc::MAXTHREADNAMESIZE }>(name); @@ -334,6 +340,7 @@ impl Drop for Thread { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "nto", ))] fn truncate_cstr<const MAX_WITH_NUL: usize>(cstr: &CStr) -> [libc::c_char; MAX_WITH_NUL] { diff --git a/library/std/src/sys/pal/unix/thread_local_dtor.rs b/library/std/src/sys/pal/unix/thread_local_dtor.rs index 79b152cece9..1c0b39e652f 100644 --- a/library/std/src/sys/pal/unix/thread_local_dtor.rs +++ b/library/std/src/sys/pal/unix/thread_local_dtor.rs @@ -76,7 +76,13 @@ pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) { // workaround below is to register, via _tlv_atexit, a custom DTOR list once per // thread. thread_local dtors are pushed to the DTOR list without calling // _tlv_atexit. -#[cfg(any(target_os = "macos", target_os = "ios", target_os = "watchos", target_os = "tvos"))] +#[cfg(any( + target_os = "macos", + target_os = "ios", + target_os = "watchos", + target_os = "visionos", + target_os = "tvos" +))] pub unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern "C" fn(*mut u8)) { use crate::cell::{Cell, RefCell}; use crate::ptr; diff --git a/library/std/src/sys/pal/unix/thread_parking/mod.rs b/library/std/src/sys/pal/unix/thread_parking/mod.rs index 185333c072f..3348d4b366d 100644 --- a/library/std/src/sys/pal/unix/thread_parking/mod.rs +++ b/library/std/src/sys/pal/unix/thread_parking/mod.rs @@ -16,6 +16,7 @@ cfg_if::cfg_if! { target_os = "macos", target_os = "ios", target_os = "watchos", + target_os = "visionos", target_os = "tvos", ), not(miri), diff --git a/library/std/src/sys/pal/unix/thread_parking/pthread.rs b/library/std/src/sys/pal/unix/thread_parking/pthread.rs index ae805d84399..ba19b53e808 100644 --- a/library/std/src/sys/pal/unix/thread_parking/pthread.rs +++ b/library/std/src/sys/pal/unix/thread_parking/pthread.rs @@ -48,6 +48,7 @@ unsafe fn wait_timeout( target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "espidf", target_os = "horizon", ))] @@ -76,6 +77,7 @@ unsafe fn wait_timeout( target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "espidf", target_os = "horizon", )))] @@ -124,6 +126,7 @@ impl Parker { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "l4re", target_os = "android", target_os = "redox", diff --git a/library/std/src/sys/pal/unix/time.rs b/library/std/src/sys/pal/unix/time.rs index 0440f33ded1..e69775be8cf 100644 --- a/library/std/src/sys/pal/unix/time.rs +++ b/library/std/src/sys/pal/unix/time.rs @@ -90,7 +90,8 @@ impl Timespec { target_os = "macos", target_os = "ios", target_os = "tvos", - target_os = "watchos" + target_os = "watchos", + target_os = "visionos", ))] let (tv_sec, tv_nsec) = if (tv_sec <= 0 && tv_sec > i64::MIN) && (tv_nsec < 0 && tv_nsec > -1_000_000_000) { @@ -278,6 +279,7 @@ impl Instant { target_os = "macos", target_os = "ios", target_os = "watchos", + target_os = "visionos", target_os = "tvos" ))] const clock_id: libc::clockid_t = libc::CLOCK_UPTIME_RAW; @@ -285,6 +287,7 @@ impl Instant { target_os = "macos", target_os = "ios", target_os = "watchos", + target_os = "visionos", target_os = "tvos" )))] const clock_id: libc::clockid_t = libc::CLOCK_MONOTONIC; diff --git a/library/std/src/sys/personality/gcc.rs b/library/std/src/sys/personality/gcc.rs index 6f317131145..b0f744dd966 100644 --- a/library/std/src/sys/personality/gcc.rs +++ b/library/std/src/sys/personality/gcc.rs @@ -92,7 +92,7 @@ const UNWIND_DATA_REG: (i32, i32) = (4, 5); // a0, a1 // https://github.com/gcc-mirror/gcc/blob/trunk/libgcc/unwind-c.c cfg_if::cfg_if! { - if #[cfg(all(target_arch = "arm", not(target_os = "ios"), not(target_os = "tvos"), not(target_os = "watchos"), not(target_os = "netbsd")))] { + if #[cfg(all(target_arch = "arm", not(target_os = "ios"), not(target_os = "tvos"), not(target_os = "watchos"), not(target_os = "visionos"), not(target_os = "netbsd")))] { // ARM EHABI personality routine. // https://web.archive.org/web/20190728160938/https://infocenter.arm.com/help/topic/com.arm.doc.ihi0038b/IHI0038B_ehabi.pdf // diff --git a/library/std/src/sys/sync/condvar/pthread.rs b/library/std/src/sys/sync/condvar/pthread.rs index 728371685ee..0475f985078 100644 --- a/library/std/src/sys/sync/condvar/pthread.rs +++ b/library/std/src/sys/sync/condvar/pthread.rs @@ -34,6 +34,7 @@ impl LazyInit for AllocatedCondvar { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "l4re", target_os = "android", target_os = "redox" @@ -127,6 +128,7 @@ impl Condvar { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "android", target_os = "espidf", target_os = "horizon" @@ -162,6 +164,7 @@ impl Condvar { target_os = "ios", target_os = "tvos", target_os = "watchos", + target_os = "visionos", target_os = "android", target_os = "espidf", target_os = "horizon" |
