Rollup merge of #40457 - frewsxcv:frewsxcv-macos, r=steveklabnik
Update usages of 'OSX' (and other old names) to 'macOS'. As of last year with version 'Sierra', the Mac operating system is now called 'macOS'.
This commit is contained in:
@@ -96,17 +96,17 @@ pub unsafe extern fn destroy_value<T>(ptr: *mut u8) {
|
||||
// `None`.
|
||||
(*ptr).dtor_running.set(true);
|
||||
|
||||
// The OSX implementation of TLS apparently had an odd aspect to it
|
||||
// The macOS implementation of TLS apparently had an odd aspect to it
|
||||
// where the pointer we have may be overwritten while this destructor
|
||||
// is running. Specifically if a TLS destructor re-accesses TLS it may
|
||||
// trigger a re-initialization of all TLS variables, paving over at
|
||||
// least some destroyed ones with initial values.
|
||||
//
|
||||
// This means that if we drop a TLS value in place on OSX that we could
|
||||
// This means that if we drop a TLS value in place on macOS that we could
|
||||
// revert the value to its original state halfway through the
|
||||
// destructor, which would be bad!
|
||||
//
|
||||
// Hence, we use `ptr::read` on OSX (to move to a "safe" location)
|
||||
// Hence, we use `ptr::read` on macOS (to move to a "safe" location)
|
||||
// instead of drop_in_place.
|
||||
if cfg!(target_os = "macos") {
|
||||
ptr::read((*ptr).inner.get());
|
||||
|
||||
@@ -249,7 +249,7 @@ impl Command {
|
||||
// mutex, and then after the fork they unlock it.
|
||||
//
|
||||
// Despite this information, libnative's spawn has been witnessed to
|
||||
// deadlock on both OSX and FreeBSD. I'm not entirely sure why, but
|
||||
// deadlock on both macOS and FreeBSD. I'm not entirely sure why, but
|
||||
// all collected backtraces point at malloc/free traffic in the
|
||||
// child spawned process.
|
||||
//
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
/// Some methods of getting a backtrace:
|
||||
///
|
||||
/// * The backtrace() functions on unix. It turns out this doesn't work very
|
||||
/// well for green threads on OSX, and the address to symbol portion of it
|
||||
/// well for green threads on macOS, and the address to symbol portion of it
|
||||
/// suffers problems that are described below.
|
||||
///
|
||||
/// * Using libunwind. This is more difficult than it sounds because libunwind
|
||||
@@ -51,9 +51,9 @@
|
||||
///
|
||||
/// * Use dladdr(). The original backtrace()-based idea actually uses dladdr()
|
||||
/// behind the scenes to translate, and this is why backtrace() was not used.
|
||||
/// Conveniently, this method works fantastically on OSX. It appears dladdr()
|
||||
/// Conveniently, this method works fantastically on macOS. It appears dladdr()
|
||||
/// uses magic to consult the local symbol table, or we're putting everything
|
||||
/// in the dynamic symbol table anyway. Regardless, for OSX, this is the
|
||||
/// in the dynamic symbol table anyway. Regardless, for macOS, this is the
|
||||
/// method used for translation. It's provided by the system and easy to do.o
|
||||
///
|
||||
/// Sadly, all other systems have a dladdr() implementation that does not
|
||||
@@ -75,7 +75,7 @@
|
||||
/// * Use `libbacktrace`. It turns out that this is a small library bundled in
|
||||
/// the gcc repository which provides backtrace and symbol translation
|
||||
/// functionality. All we really need from it is the backtrace functionality,
|
||||
/// and we only really need this on everything that's not OSX, so this is the
|
||||
/// and we only really need this on everything that's not macOS, so this is the
|
||||
/// chosen route for now.
|
||||
///
|
||||
/// In summary, the current situation uses libgcc_s to get a trace of stack
|
||||
|
||||
@@ -204,7 +204,7 @@ impl SocketAddr {
|
||||
let len = self.len as usize - sun_path_offset();
|
||||
let path = unsafe { mem::transmute::<&[libc::c_char], &[u8]>(&self.addr.sun_path) };
|
||||
|
||||
// OSX seems to return a len of 16 and a zeroed sun_path for unnamed addresses
|
||||
// macOS seems to return a len of 16 and a zeroed sun_path for unnamed addresses
|
||||
if len == 0 || (cfg!(not(target_os = "linux")) && self.addr.sun_path[0] == 0) {
|
||||
AddressKind::Unnamed
|
||||
} else if self.addr.sun_path[0] == 0 {
|
||||
|
||||
@@ -128,7 +128,7 @@ unsafe fn register_dtor(t: *mut u8, dtor: unsafe extern fn(*mut u8)) {
|
||||
register_dtor_fallback(t, dtor);
|
||||
}
|
||||
|
||||
// OSX's analog of the above linux function is this _tlv_atexit function.
|
||||
// macOS's analog of the above linux function is this _tlv_atexit function.
|
||||
// The disassembly of thread_local globals in C++ (at least produced by
|
||||
// clang) will have this show up in the output.
|
||||
#[cfg(target_os = "macos")]
|
||||
@@ -154,17 +154,17 @@ pub unsafe extern fn destroy_value<T>(ptr: *mut u8) {
|
||||
// `None`.
|
||||
(*ptr).dtor_running.set(true);
|
||||
|
||||
// The OSX implementation of TLS apparently had an odd aspect to it
|
||||
// The macOS implementation of TLS apparently had an odd aspect to it
|
||||
// where the pointer we have may be overwritten while this destructor
|
||||
// is running. Specifically if a TLS destructor re-accesses TLS it may
|
||||
// trigger a re-initialization of all TLS variables, paving over at
|
||||
// least some destroyed ones with initial values.
|
||||
//
|
||||
// This means that if we drop a TLS value in place on OSX that we could
|
||||
// This means that if we drop a TLS value in place on macOS that we could
|
||||
// revert the value to its original state halfway through the
|
||||
// destructor, which would be bad!
|
||||
//
|
||||
// Hence, we use `ptr::read` on OSX (to move to a "safe" location)
|
||||
// Hence, we use `ptr::read` on macOS (to move to a "safe" location)
|
||||
// instead of drop_in_place.
|
||||
if cfg!(target_os = "macos") {
|
||||
ptr::read((*ptr).inner.get());
|
||||
|
||||
@@ -29,7 +29,7 @@ fn max_len() -> usize {
|
||||
// with the man page quoting that if the count of bytes to read is
|
||||
// greater than `SSIZE_MAX` the result is "unspecified".
|
||||
//
|
||||
// On OSX, however, apparently the 64-bit libc is either buggy or
|
||||
// On macOS, however, apparently the 64-bit libc is either buggy or
|
||||
// intentionally showing odd behavior by rejecting any read with a size
|
||||
// larger than or equal to INT_MAX. To handle both of these the read
|
||||
// size is capped on both platforms.
|
||||
|
||||
@@ -439,7 +439,7 @@ impl File {
|
||||
// Linux kernel then the flag is just ignored by the OS, so we continue
|
||||
// to explicitly ask for a CLOEXEC fd here.
|
||||
//
|
||||
// The CLOEXEC flag, however, is supported on versions of OSX/BSD/etc
|
||||
// The CLOEXEC flag, however, is supported on versions of macOS/BSD/etc
|
||||
// that we support, so we only do this on Linux currently.
|
||||
if cfg!(target_os = "linux") {
|
||||
fd.set_cloexec()?;
|
||||
@@ -573,7 +573,7 @@ impl fmt::Debug for File {
|
||||
#[cfg(target_os = "macos")]
|
||||
fn get_path(fd: c_int) -> Option<PathBuf> {
|
||||
// FIXME: The use of PATH_MAX is generally not encouraged, but it
|
||||
// is inevitable in this case because OS X defines `fcntl` with
|
||||
// is inevitable in this case because macOS defines `fcntl` with
|
||||
// `F_GETPATH` in terms of `MAXPATHLEN`, and there are no
|
||||
// alternatives. If a better method is invented, it should be used
|
||||
// instead.
|
||||
|
||||
@@ -434,8 +434,8 @@ mod tests {
|
||||
}
|
||||
|
||||
// See #14232 for more information, but it appears that signal delivery to a
|
||||
// newly spawned process may just be raced in the OSX, so to prevent this
|
||||
// test from being flaky we ignore it on OSX.
|
||||
// newly spawned process may just be raced in the macOS, so to prevent this
|
||||
// test from being flaky we ignore it on macOS.
|
||||
#[test]
|
||||
#[cfg_attr(target_os = "macos", ignore)]
|
||||
#[cfg_attr(target_os = "nacl", ignore)] // no signals on NaCl.
|
||||
|
||||
@@ -129,7 +129,7 @@ impl Command {
|
||||
// mutex, and then after the fork they unlock it.
|
||||
//
|
||||
// Despite this information, libnative's spawn has been witnessed to
|
||||
// deadlock on both OSX and FreeBSD. I'm not entirely sure why, but
|
||||
// deadlock on both macOS and FreeBSD. I'm not entirely sure why, but
|
||||
// all collected backtraces point at malloc/free traffic in the
|
||||
// child spawned process.
|
||||
//
|
||||
|
||||
@@ -187,7 +187,7 @@ mod imp {
|
||||
let stack = libc::stack_t {
|
||||
ss_sp: ptr::null_mut(),
|
||||
ss_flags: SS_DISABLE,
|
||||
// Workaround for bug in MacOS implementation of sigaltstack
|
||||
// Workaround for bug in macOS implementation of sigaltstack
|
||||
// UNIX2003 which returns ENOMEM when disabling a stack while
|
||||
// passing ss_size smaller than MINSIGSTKSZ. According to POSIX
|
||||
// both ss_sp and ss_size should be ignored in this case.
|
||||
|
||||
Reference in New Issue
Block a user