Rename sunos to solaris
This commit is contained in:
@@ -50,14 +50,14 @@ impl FileDesc {
|
||||
Ok(ret as usize)
|
||||
}
|
||||
|
||||
#[cfg(not(any(target_env = "newlib", target_os = "sunos")))]
|
||||
#[cfg(not(any(target_env = "newlib", target_os = "solaris")))]
|
||||
pub fn set_cloexec(&self) {
|
||||
unsafe {
|
||||
let ret = libc::ioctl(self.fd, libc::FIOCLEX);
|
||||
debug_assert_eq!(ret, 0);
|
||||
}
|
||||
}
|
||||
#[cfg(any(target_env = "newlib", target_os = "sunos"))]
|
||||
#[cfg(any(target_env = "newlib", target_os = "solaris"))]
|
||||
pub fn set_cloexec(&self) {
|
||||
unsafe {
|
||||
let previous = libc::fcntl(self.fd, libc::F_GETFD);
|
||||
|
||||
@@ -24,9 +24,9 @@ use sys::platform::raw;
|
||||
use sys::{cvt, cvt_r};
|
||||
use sys_common::{AsInner, FromInner};
|
||||
use vec::Vec;
|
||||
#[cfg(target_os = "sunos")]
|
||||
#[cfg(target_os = "solaris")]
|
||||
use core_collections::borrow::ToOwned;
|
||||
#[cfg(target_os = "sunos")]
|
||||
#[cfg(target_os = "solaris")]
|
||||
use boxed::Box;
|
||||
|
||||
pub struct File(FileDesc);
|
||||
@@ -53,7 +53,7 @@ pub struct DirEntry {
|
||||
// on Solaris because a) it uses a zero-length array to
|
||||
// store the name, b) its lifetime between readdir calls
|
||||
// is not guaranteed.
|
||||
#[cfg(target_os = "sunos")]
|
||||
#[cfg(target_os = "solaris")]
|
||||
name: Box<[u8]>
|
||||
}
|
||||
|
||||
@@ -141,7 +141,7 @@ impl FromInner<raw::mode_t> for FilePermissions {
|
||||
impl Iterator for ReadDir {
|
||||
type Item = io::Result<DirEntry>;
|
||||
|
||||
#[cfg(target_os = "sunos")]
|
||||
#[cfg(target_os = "solaris")]
|
||||
fn next(&mut self) -> Option<io::Result<DirEntry>> {
|
||||
unsafe {
|
||||
loop {
|
||||
@@ -170,7 +170,7 @@ impl Iterator for ReadDir {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "sunos"))]
|
||||
#[cfg(not(target_os = "solaris"))]
|
||||
fn next(&mut self) -> Option<io::Result<DirEntry>> {
|
||||
unsafe {
|
||||
let mut ret = DirEntry {
|
||||
@@ -213,12 +213,12 @@ impl DirEntry {
|
||||
lstat(&self.path())
|
||||
}
|
||||
|
||||
#[cfg(target_os = "sunos")]
|
||||
#[cfg(target_os = "solaris")]
|
||||
pub fn file_type(&self) -> io::Result<FileType> {
|
||||
stat(&self.path()).map(|m| m.file_type())
|
||||
}
|
||||
|
||||
#[cfg(not(target_os = "sunos"))]
|
||||
#[cfg(not(target_os = "solaris"))]
|
||||
pub fn file_type(&self) -> io::Result<FileType> {
|
||||
match self.entry.d_type {
|
||||
libc::DT_CHR => Ok(FileType { mode: libc::S_IFCHR }),
|
||||
@@ -235,7 +235,7 @@ impl DirEntry {
|
||||
#[cfg(any(target_os = "macos",
|
||||
target_os = "ios",
|
||||
target_os = "linux",
|
||||
target_os = "sunos"))]
|
||||
target_os = "solaris"))]
|
||||
pub fn ino(&self) -> raw::ino_t {
|
||||
self.entry.d_ino
|
||||
}
|
||||
@@ -280,7 +280,7 @@ impl DirEntry {
|
||||
CStr::from_ptr(self.entry.d_name.as_ptr()).to_bytes()
|
||||
}
|
||||
}
|
||||
#[cfg(target_os = "sunos")]
|
||||
#[cfg(target_os = "solaris")]
|
||||
fn name_bytes(&self) -> &[u8] {
|
||||
&*self.name
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ use ops::Neg;
|
||||
#[cfg(target_os = "nacl")] pub use os::nacl as platform;
|
||||
#[cfg(target_os = "netbsd")] pub use os::netbsd as platform;
|
||||
#[cfg(target_os = "openbsd")] pub use os::openbsd as platform;
|
||||
#[cfg(target_os = "sunos")] pub use os::sunos as platform;
|
||||
#[cfg(target_os = "solaris")] pub use os::solaris as platform;
|
||||
|
||||
pub mod backtrace;
|
||||
pub mod condvar;
|
||||
|
||||
@@ -45,7 +45,7 @@ pub fn errno() -> i32 {
|
||||
target_os = "android",
|
||||
target_env = "newlib"),
|
||||
link_name = "__errno")]
|
||||
#[cfg_attr(target_os = "sunos", link_name = "___errno")]
|
||||
#[cfg_attr(target_os = "solaris", link_name = "___errno")]
|
||||
#[cfg_attr(target_os = "dragonfly", link_name = "__dfly_error")]
|
||||
#[cfg_attr(any(target_os = "macos",
|
||||
target_os = "ios",
|
||||
@@ -258,7 +258,7 @@ pub fn current_exe() -> io::Result<PathBuf> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "sunos"))]
|
||||
#[cfg(any(target_os = "solaris"))]
|
||||
pub fn current_exe() -> io::Result<PathBuf> {
|
||||
extern {
|
||||
fn getexecname() -> *const c_char;
|
||||
@@ -384,7 +384,7 @@ pub fn args() -> Args {
|
||||
target_os = "bitrig",
|
||||
target_os = "netbsd",
|
||||
target_os = "openbsd",
|
||||
target_os = "sunos",
|
||||
target_os = "solaris",
|
||||
target_os = "nacl"))]
|
||||
pub fn args() -> Args {
|
||||
use sys_common;
|
||||
@@ -507,7 +507,7 @@ pub fn home_dir() -> Option<PathBuf> {
|
||||
fallback()
|
||||
}).map(PathBuf::from);
|
||||
|
||||
#[cfg(not(target_os = "sunos"))]
|
||||
#[cfg(not(target_os = "solaris"))]
|
||||
unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,
|
||||
buf: &mut Vec<c_char>) -> Option<()> {
|
||||
let mut result = ptr::null_mut();
|
||||
@@ -519,7 +519,7 @@ pub fn home_dir() -> Option<PathBuf> {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(target_os = "sunos")]
|
||||
#[cfg(target_os = "solaris")]
|
||||
unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,
|
||||
buf: &mut Vec<c_char>) -> Option<()> {
|
||||
// getpwuid_r semantics is different on Illumos/Solaris:
|
||||
|
||||
@@ -93,7 +93,7 @@ fn os2c(s: &OsStr) -> CString {
|
||||
pub struct ExitStatus(c_int);
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "android",
|
||||
target_os = "nacl", target_os = "sunos"))]
|
||||
target_os = "nacl", target_os = "solaris"))]
|
||||
mod status_imp {
|
||||
pub fn WIFEXITED(status: i32) -> bool { (status & 0xff) == 0 }
|
||||
pub fn WEXITSTATUS(status: i32) -> i32 { (status >> 8) & 0xff }
|
||||
|
||||
@@ -39,7 +39,7 @@ impl Drop for Handler {
|
||||
target_os = "bitrig",
|
||||
target_os = "dragonfly",
|
||||
target_os = "freebsd",
|
||||
target_os = "sunos",
|
||||
target_os = "solaris",
|
||||
all(target_os = "netbsd", not(target_vendor = "rumprun")),
|
||||
target_os = "openbsd"))]
|
||||
mod imp {
|
||||
@@ -168,7 +168,7 @@ mod imp {
|
||||
target_os = "bitrig",
|
||||
target_os = "dragonfly",
|
||||
target_os = "freebsd",
|
||||
target_os = "sunos",
|
||||
target_os = "solaris",
|
||||
all(target_os = "netbsd", not(target_vendor = "rumprun")),
|
||||
target_os = "openbsd")))]
|
||||
mod imp {
|
||||
|
||||
@@ -12,7 +12,7 @@ use prelude::v1::*;
|
||||
|
||||
use alloc::boxed::FnBox;
|
||||
use cmp;
|
||||
#[cfg(not(any(target_env = "newlib", target_os = "sunos")))]
|
||||
#[cfg(not(any(target_env = "newlib", target_os = "solaris")))]
|
||||
use ffi::CString;
|
||||
use io;
|
||||
use libc;
|
||||
@@ -122,7 +122,7 @@ impl Thread {
|
||||
carg.as_ptr() as *mut libc::c_void);
|
||||
}
|
||||
}
|
||||
#[cfg(any(target_env = "newlib", target_os = "sunos"))]
|
||||
#[cfg(any(target_env = "newlib", target_os = "solaris"))]
|
||||
pub fn set_name(_name: &str) {
|
||||
// Newlib and Illumos has no way to set a thread name.
|
||||
}
|
||||
@@ -171,7 +171,7 @@ impl Drop for Thread {
|
||||
not(target_os = "bitrig"),
|
||||
not(all(target_os = "netbsd", not(target_vendor = "rumprun"))),
|
||||
not(target_os = "openbsd"),
|
||||
not(target_os = "sunos")))]
|
||||
not(target_os = "solaris")))]
|
||||
#[cfg_attr(test, allow(dead_code))]
|
||||
pub mod guard {
|
||||
pub unsafe fn current() -> Option<usize> { None }
|
||||
@@ -184,7 +184,7 @@ pub mod guard {
|
||||
target_os = "bitrig",
|
||||
all(target_os = "netbsd", not(target_vendor = "rumprun")),
|
||||
target_os = "openbsd",
|
||||
target_os = "sunos"))]
|
||||
target_os = "solaris"))]
|
||||
#[cfg_attr(test, allow(dead_code))]
|
||||
pub mod guard {
|
||||
use prelude::v1::*;
|
||||
@@ -197,7 +197,7 @@ pub mod guard {
|
||||
#[cfg(any(target_os = "macos",
|
||||
target_os = "bitrig",
|
||||
target_os = "openbsd",
|
||||
target_os = "sunos"))]
|
||||
target_os = "solaris"))]
|
||||
unsafe fn get_stack_start() -> Option<*mut libc::c_void> {
|
||||
current().map(|s| s as *mut libc::c_void)
|
||||
}
|
||||
@@ -256,7 +256,7 @@ pub mod guard {
|
||||
Some(stackaddr as usize + offset * psize)
|
||||
}
|
||||
|
||||
#[cfg(target_os = "sunos")]
|
||||
#[cfg(target_os = "solaris")]
|
||||
pub unsafe fn current() -> Option<usize> {
|
||||
let mut current_stack: libc::stack_t = mem::zeroed();
|
||||
assert_eq!(libc::stack_getbounds(&mut current_stack), 0);
|
||||
|
||||
Reference in New Issue
Block a user