This is dependent on https://github.com/rust-lang/rust-installer/pull/38. Once it is merged we most likely need to update the commit.
CFG_OSTYPE=unknown-openbsd
;;
+ NetBSD)
+ CFG_OSTYPE=unknown-netbsd
+ ;;
+
Darwin)
CFG_OSTYPE=apple-darwin
;;
--- /dev/null
+# x86_64-unknown-netbsd configuration
+CC_x86_64-unknown-netbsd=$(CC)
+CXX_x86_64-unknown-netbsd=$(CXX)
+CPP_x86_64-unknown-netbsd=$(CPP)
+AR_x86_64-unknown-netbsd=$(AR)
+CFG_LIB_NAME_x86_64-unknown-netbsd=lib$(1).so
+CFG_STATIC_LIB_NAME_x86_64-unknown-netbsd=lib$(1).a
+CFG_LIB_GLOB_x86_64-unknown-netbsd=lib$(1)-*.so
+CFG_LIB_DSYM_GLOB_x86_64-unknown-netbsd=$(1)-*.dylib.dSYM
+CFG_JEMALLOC_CFLAGS_x86_64-unknown-netbsd := -I/usr/local/include $(CFLAGS)
+CFG_GCCISH_CFLAGS_x86_64-unknown-netbsd := -Wall -Werror -g -fPIC -I/usr/local/include $(CFLAGS)
+CFG_GCCISH_LINK_FLAGS_x86_64-unknown-netbsd := -shared -fPIC -g -pthread -lrt
+CFG_GCCISH_DEF_FLAG_x86_64-unknown-netbsd := -Wl,--export-dynamic,--dynamic-list=
+CFG_LLC_FLAGS_x86_64-unknown-netbsd :=
+CFG_INSTALL_NAME_x86_64-unknown-netbsd =
+CFG_EXE_SUFFIX_x86_64-unknown-netbsd :=
+CFG_WINDOWSY_x86_64-unknown-netbsd :=
+CFG_UNIXY_x86_64-unknown-netbsd := 1
+CFG_LDPATH_x86_64-unknown-netbsd :=
+CFG_RUN_x86_64-unknown-netbsd=$(2)
+CFG_RUN_TARG_x86_64-unknown-netbsd=$(call CFG_RUN_x86_64-unknown-netbsd,,$(2))
+CFG_GNU_TRIPLE_x86_64-unknown-netbsd := x86_64-unknown-netbsd
("ios", "ios"),
("linux", "linux"),
("mingw32", "windows"),
+ ("netbsd", "netbsd"),
("openbsd", "openbsd"),
("win32", "windows"),
("windows", "windows"),
as a configuration itself, like `unix` or `windows`.
* `target_os = "..."`. Operating system of the target, examples include
`"windows"`, `"macos"`, `"ios"`, `"linux"`, `"android"`, `"freebsd"`, `"dragonfly"`,
- `"bitrig"` or `"openbsd"`.
+ `"bitrig"` , `"openbsd"` or `"netbsd"`.
* `target_pointer_width = "..."`. Target pointer width in bits. This is set
to `"32"` for targets with 32-bit pointers, and likewise set to `"64"` for
64-bit pointers.
download_unpack_base = os.path.join(download_dir_base, "unpack")
snapshot_files = {
+ "bitrig": ["bin/rustc"],
+ "dragonfly": ["bin/rustc"],
+ "freebsd": ["bin/rustc"],
"linux": ["bin/rustc"],
"macos": ["bin/rustc"],
- "winnt": ["bin/rustc.exe"],
- "freebsd": ["bin/rustc"],
- "dragonfly": ["bin/rustc"],
- "bitrig": ["bin/rustc"],
+ "netbsd": ["bin/rustc"],
"openbsd": ["bin/rustc"],
+ "winnt": ["bin/rustc.exe"],
}
winnt_runtime_deps_32 = ["libgcc_s_dw2-1.dll", "libstdc++-6.dll"]
return "dragonfly"
if os_name == "bitrig":
return "bitrig"
+ if os_name == "netbsd":
+ return "netbsd"
if os_name == "openbsd":
return "openbsd"
return "linux"
}
}
- #[cfg(any(target_os = "bitrig", target_os = "openbsd"))]
+ #[cfg(any(target_os = "bitrig", target_os = "netbsd", target_os ="openbsd"))]
pub mod os {
pub mod common {
pub mod posix01 {
pub __unused7: *mut c_void,
}
- #[cfg(target_os = "openbsd")]
+ #[cfg(any(target_os = "netbsd", target_os="openbsd"))]
#[repr(C)]
#[derive(Copy, Clone)] pub struct glob_t {
pub gl_pathc: c_int,
}
}
- #[cfg(any(target_os = "bitrig", target_os = "openbsd"))]
+ #[cfg(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"))]
pub mod os {
pub mod c95 {
use types::os::arch::c95::{c_int, c_uint};
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd",
target_os = "nacl"))]
pub mod posix88 {
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd",
target_os = "android",
target_os = "ios",
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd",
target_os = "android",
target_os = "ios",
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd",
target_os = "nacl"))]
pub mod posix01 {
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd",
target_os = "android",
target_os = "ios",
}
- #[cfg(any(target_os = "windows",
- target_os = "linux",
- target_os = "android",
- target_os = "macos",
+ #[cfg(any(target_os = "android",
+ target_os = "bitrig",
+ target_os = "dragonfly",
target_os = "ios",
target_os = "freebsd",
- target_os = "dragonfly",
- target_os = "bitrig",
+ target_os = "linux",
+ target_os = "macos",
+ target_os = "nacl",
+ target_os = "netbsd",
target_os = "openbsd",
- target_os = "nacl"))]
+ target_os = "windows"))]
pub mod posix08 {
pub mod unistd {
}
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
pub mod bsd44 {
use types::common::c95::{c_void};
#[cfg(any(target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
pub mod extra {
}
-a:0:64-n32".to_string()
}
- abi::OsFreebsd | abi::OsDragonfly | abi::OsBitrig | abi::OsOpenbsd => {
+ abi::OsFreebsd | abi::OsDragonfly | abi::OsBitrig | abi::OsOpenbsd | abi::OsNetbsd => {
"e-p:32:32:32\
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
-f32:32:32-f64:64:64\
-a:0:64-n32".to_string()
}
- abi::OsFreebsd | abi::OsDragonfly | abi::OsBitrig | abi::OsOpenbsd => {
+ abi::OsBitrig | abi::OsDragonfly | abi::OsFreebsd | abi::OsNetbsd | abi::OsOpenbsd => {
"E-p:32:32:32\
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
-f32:32:32-f64:64:64\
-a:0:64-n32".to_string()
}
- abi::OsFreebsd | abi::OsDragonfly | abi::OsBitrig | abi::OsOpenbsd => {
+ abi::OsFreebsd | abi::OsDragonfly | abi::OsBitrig | abi::OsOpenbsd | abi::OsNetbsd => {
"e-p:32:32:32\
-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64\
-f32:32:32-f64:64:64\
mod freebsd_base;
mod linux_base;
mod openbsd_base;
+mod netbsd_base;
mod windows_base;
mod windows_msvc_base;
x86_64_unknown_bitrig,
x86_64_unknown_openbsd,
+ x86_64_unknown_netbsd,
x86_64_apple_darwin,
i686_apple_darwin,
--- /dev/null
+// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use target::TargetOptions;
+use std::default::Default;
+
+pub fn opts() -> TargetOptions {
+ TargetOptions {
+ linker: "cc".to_string(),
+ dynamic_linking: true,
+ executables: true,
+ morestack: false,
+ linker_is_gnu: true,
+ has_rpath: true,
+ pre_link_args: vec!(
+ // GNU-style linkers will use this to omit linking to libraries
+ // which don't actually fulfill any relocations, but only for
+ // libraries which follow this flag. Thus, use it before
+ // specifying libraries to link to.
+ "-Wl,--as-needed".to_string(),
+ ),
+ position_independent_executables: true,
+ .. Default::default()
+ }
+}
--- /dev/null
+// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+use target::Target;
+
+pub fn target() -> Target {
+ let mut base = super::netbsd_base::opts();
+ base.pre_link_args.push("-m64".to_string());
+
+ Target {
+ data_layout: "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
+ f32:32:32-f64:64:64-v64:64:64-v128:128:128-a:0:64-\
+ s0:64:64-f80:128:128-n8:16:32:64-S128".to_string(),
+ llvm_target: "x86_64-unknown-netbsd".to_string(),
+ target_endian: "little".to_string(),
+ target_pointer_width: "64".to_string(),
+ arch: "x86_64".to_string(),
+ target_os: "netbsd".to_string(),
+ target_env: "".to_string(),
+ options: base,
+ }
+}
"e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32".to_string()
}
- abi::OsFreebsd | abi::OsDragonfly | abi::OsBitrig | abi::OsOpenbsd => {
+ abi::OsFreebsd | abi::OsDragonfly | abi::OsBitrig | abi::OsOpenbsd | abi::OsNetbsd => {
"e-p:32:32-f64:32:64-i64:32:64-f80:32:32-n8:16:32".to_string()
}
s0:64:64-f80:128:128-n8:16:32:64-S128".to_string()
}
- abi::OsFreebsd | abi::OsDragonfly | abi::OsBitrig | abi::OsOpenbsd => {
+ abi::OsBitrig | abi::OsDragonfly | abi::OsFreebsd | abi::OsNetbsd | abi::OsOpenbsd => {
"e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-\
f32:32:32-f64:64:64-v64:64:64-v128:128:128-a:0:64-\
s0:64:64-f80:128:128-n8:16:32:64-S128".to_string()
#[cfg(any(target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
mod os {
use libc;
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
fn test_errors_do_not_crash() {
// Open /dev/null as a library to get an error, and make sure
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
mod dl {
use prelude::v1::*;
/// - freebsd
/// - dragonfly
/// - bitrig
+ /// - netbsd
/// - openbsd
/// - android
/// - windows
pub const EXE_EXTENSION: &'static str = "";
}
+#[cfg(target_os = "netbsd")]
+mod os {
+ pub const FAMILY: &'static str = "unix";
+ pub const OS: &'static str = "netbsd";
+ pub const DLL_PREFIX: &'static str = "lib";
+ pub const DLL_SUFFIX: &'static str = ".so";
+ pub const DLL_EXTENSION: &'static str = "so";
+ pub const EXE_SUFFIX: &'static str = "";
+ pub const EXE_EXTENSION: &'static str = "";
+}
+
#[cfg(target_os = "openbsd")]
mod os {
pub const FAMILY: &'static str = "unix";
// FIXME: re-enabled bitrig/openbsd tests once their socket timeout code
// no longer has rounding errors.
- #[cfg_attr(any(target_os = "bitrig", target_os = "openbsd"), ignore)]
+ #[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)]
#[test]
fn timeouts() {
let addr = next_test_ip4();
assert_eq!(format!("{:?}", udpsock), compare);
}
- // FIXME: re-enabled bitrig/openbsd tests once their socket timeout code
+ // FIXME: re-enabled bitrig/openbsd/netbsd tests once their socket timeout code
// no longer has rounding errors.
- #[cfg_attr(any(target_os = "bitrig", target_os = "openbsd"), ignore)]
+ #[cfg_attr(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"), ignore)]
#[test]
fn timeouts() {
let addr = next_test_ip4();
#[cfg(target_os = "linux")] pub mod linux;
#[cfg(target_os = "macos")] pub mod macos;
#[cfg(target_os = "nacl")] pub mod nacl;
+#[cfg(target_os = "netbsd")] pub mod netbsd;
#[cfg(target_os = "openbsd")] pub mod openbsd;
pub mod raw;
--- /dev/null
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! OpenBSD-specific definitions
+
+#![stable(feature = "raw_ext", since = "1.1.0")]
+
+pub mod raw;
+
+pub mod fs {
+ #![stable(feature = "raw_ext", since = "1.1.0")]
+ pub use sys::fs::MetadataExt;
+}
--- /dev/null
+// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+//! NetBSD/OpenBSD-specific raw type definitions
+
+#![stable(feature = "raw_ext", since = "1.1.0")]
+
+use os::raw::c_long;
+use os::unix::raw::{uid_t, gid_t};
+
+#[stable(feature = "raw_ext", since = "1.1.0")] pub type blkcnt_t = i64;
+#[stable(feature = "raw_ext", since = "1.1.0")] pub type blksize_t = u32;
+#[stable(feature = "raw_ext", since = "1.1.0")] pub type dev_t = i32;
+#[stable(feature = "raw_ext", since = "1.1.0")] pub type fflags_t = u32;
+#[stable(feature = "raw_ext", since = "1.1.0")] pub type ino_t = u64;
+#[stable(feature = "raw_ext", since = "1.1.0")] pub type mode_t = u32;
+#[stable(feature = "raw_ext", since = "1.1.0")] pub type nlink_t = u32;
+#[stable(feature = "raw_ext", since = "1.1.0")] pub type off_t = i64;
+#[stable(feature = "raw_ext", since = "1.1.0")] pub type time_t = i64;
+
+#[repr(C)]
+#[stable(feature = "raw_ext", since = "1.1.0")]
+pub struct stat {
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_mode: mode_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_dev: dev_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_ino: ino_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_nlink: nlink_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_uid: uid_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_gid: gid_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_rdev: dev_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_atime: time_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_atime_nsec: c_long,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_mtime: time_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_mtime_nsec: c_long,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_ctime: time_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_ctime_nsec: c_long,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_size: off_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_blocks: blkcnt_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_blksize: blksize_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_flags: fflags_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_gen: u32,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_birthtime: time_t,
+ #[stable(feature = "raw_ext", since = "1.1.0")]
+ pub st_birthtime_nsec: c_long,
+}
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
mod imp {
use prelude::v1::*;
#[link(name = "unwind", kind = "static")]
extern {}
-#[cfg(any(target_os = "android", target_os = "openbsd"))]
+#[cfg(any(target_os = "android", target_os = "netbsd", target_os = "openbsd"))]
#[link(name = "gcc")]
extern {}
#[cfg(any(target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
#[link(name = "pthread")]
extern {}
target_arch = "powerpc",
all(target_arch = "arm", target_os = "ios"),
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
unsafe fn target_record_sp_limit(_: usize) {
}
target_arch = "powerpc",
all(target_arch = "arm", target_os = "ios"),
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
#[inline(always)]
unsafe fn target_get_sp_limit() -> usize {
let selfname = if cfg!(target_os = "freebsd") ||
cfg!(target_os = "dragonfly") ||
cfg!(target_os = "bitrig") ||
+ cfg!(target_os = "netbsd") ||
cfg!(target_os = "openbsd") {
env::current_exe().ok()
} else {
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
pub const FIOCLEX: libc::c_ulong = 0x20006601;
target_os = "dragonfly"))]
pub const _SC_GETPW_R_SIZE_MAX: libc::c_int = 71;
#[cfg(any(target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
pub const _SC_GETPW_R_SIZE_MAX: libc::c_int = 101;
#[cfg(target_os = "android")]
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
pub struct passwd {
pub pw_name: *mut libc::c_char,
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
mod signal_os {
use libc;
pub struct sigset_t {
bits: [u32; 4],
}
- #[cfg(any(target_os = "bitrig", target_os = "openbsd"))]
+ #[cfg(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"))]
pub type sigset_t = libc::c_uint;
// This structure has more fields, but we're not all that interested in
pub _status: libc::c_int,
pub si_addr: *mut libc::c_void
}
- #[cfg(any(target_os = "bitrig", target_os = "openbsd"))]
+ #[cfg(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"))]
#[repr(C)]
pub struct siginfo {
pub si_signo: libc::c_int,
}
#[cfg(any(target_os = "macos", target_os = "ios",
- target_os = "bitrig", target_os = "openbsd"))]
+ target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"))]
#[repr(C)]
pub struct sigaction {
pub sa_sigaction: sighandler_t,
#[cfg(target_os = "linux")] pub use os::linux as platform;
#[cfg(target_os = "macos")] pub use os::macos as platform;
#[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;
pub mod backtrace;
__error()
}
- #[cfg(target_os = "bitrig")]
- fn errno_location() -> *const c_int {
- extern {
- fn __errno() -> *const c_int;
- }
- unsafe {
- __errno()
- }
- }
-
#[cfg(target_os = "dragonfly")]
unsafe fn errno_location() -> *const c_int {
extern { fn __dfly_error() -> *const c_int; }
__dfly_error()
}
- #[cfg(target_os = "openbsd")]
+ #[cfg(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"))]
unsafe fn errno_location() -> *const c_int {
extern { fn __errno() -> *const c_int; }
__errno()
::fs::read_link("/proc/curproc/file")
}
-#[cfg(any(target_os = "bitrig", target_os = "openbsd"))]
+#[cfg(any(target_os = "bitrig", target_os = "netbsd", target_os = "openbsd"))]
pub fn current_exe() -> io::Result<PathBuf> {
use sync::StaticMutex;
static LOCK: StaticMutex = StaticMutex::new();
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
pub fn args() -> Args {
use rt;
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
mod imp {
pub fn WIFEXITED(status: i32) -> bool { (status & 0x7f) == 0 }
#[cfg(any(target_os = "linux",
target_os = "macos",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
mod imp {
use sys_common::stack;
#[cfg(not(any(target_os = "linux",
target_os = "macos",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd")))]
mod imp {
use libc;
#[cfg(any(target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
mod os {
use libc;
#[cfg(any(target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
pub fn set_name(name: &str) {
extern {
#[cfg(all(not(target_os = "linux"),
not(target_os = "macos"),
not(target_os = "bitrig"),
+ not(target_os = "netbsd"),
not(target_os = "openbsd")))]
pub mod guard {
pub unsafe fn current() -> usize { 0 }
#[cfg(any(target_os = "linux",
target_os = "macos",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
#[allow(unused_imports)]
pub mod guard {
#[cfg(any(target_os = "macos",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
unsafe fn get_stack_start() -> *mut libc::c_void {
current() as *mut libc::c_void
pthread_get_stacksize_np(pthread_self())) as usize
}
- #[cfg(any(target_os = "openbsd", target_os = "bitrig"))]
+ #[cfg(any(target_os = "openbsd", target_os = "netbsd", target_os = "bitrig"))]
pub unsafe fn current() -> usize {
#[repr(C)]
struct stack_t {
#[cfg(any(target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd"))]
type pthread_key_t = ::libc::c_int;
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd")))]
type pthread_key_t = ::libc::c_uint;
// OpenBSD provide it via libc
#[cfg(not(any(target_os = "android",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd",
target_env = "musl")))]
#[link(name = "rt")]
#[cfg_attr(not(any(windows,
target_os = "android",
target_os = "ios",
+ target_os = "netbsd",
target_os = "openbsd",
target_arch = "aarch64")),
thread_local)]
#[cfg(not(any(windows,
target_os = "android",
target_os = "ios",
+ target_os = "netbsd",
target_os = "openbsd",
target_arch = "aarch64",
no_elf_tls)))]
#[cfg(any(windows,
target_os = "android",
target_os = "ios",
+ target_os = "netbsd",
target_os = "openbsd",
target_arch = "aarch64",
no_elf_tls))]
OsiOS,
OsDragonfly,
OsBitrig,
+ OsNetbsd,
OsOpenbsd,
}
OsFreebsd => "freebsd".fmt(f),
OsDragonfly => "dragonfly".fmt(f),
OsBitrig => "bitrig".fmt(f),
+ OsNetbsd => "netbsd".fmt(f),
OsOpenbsd => "openbsd".fmt(f),
}
}
// ignore-windows
// ignore-freebsd
// ignore-openbsd
+// ignore-netbsd
// ignore-bitrig
// compile-flags: -Z parse-only
target_os = "macos",
target_os = "freebsd",
target_os = "dragonfly",
+ target_os = "netbsd",
target_os = "openbsd"))]
mod m {
#[main]
target_os = "macos",
target_os = "freebsd",
target_os = "dragonfly",
+ target_os = "netbsd",
target_os = "openbsd"))]
mod m {
#[cfg(target_arch = "x86")]
// except according to those terms.
// ignore-android needs extra network permissions
-// ignore-openbsd system ulimit (Too many open files)
// ignore-bitrig system ulimit (Too many open files)
+// ignore-netbsd system ulimit (Too many open files)
+// ignore-openbsd system ulimit (Too many open files)
use std::io::prelude::*;
use std::net::{TcpListener, TcpStream};
target_os = "freebsd",
target_os = "dragonfly",
target_os = "bitrig",
+ target_os = "netbsd",
target_os = "openbsd",
target_os = "android"))]
pub fn main() { }