summaryrefslogtreecommitdiff
path: root/src/unix/mod.rs
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2020-04-11 19:09:29 +0900
committerGitHub <noreply@github.com>2020-04-11 19:09:29 +0900
commit9782b7ff8f6385e8411515902e8d4d4bfd4ab689 (patch)
treeb43ed29908ccefd54b5d65389dc95b548345432b /src/unix/mod.rs
parent035a4809428d319e72ff1aaae5c5335f18623836 (diff)
parent48594dc7c151b47a741259f930ba51d460ede228 (diff)
downloadrust-libc-9782b7ff8f6385e8411515902e8d4d4bfd4ab689.tar.gz
Merge pull request #1716 from pfmooney/illumos-target
Split up Solaris and illumos targets
Diffstat (limited to 'src/unix/mod.rs')
-rw-r--r--src/unix/mod.rs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/unix/mod.rs b/src/unix/mod.rs
index 9c2cafcbc0..364ff5590d 100644
--- a/src/unix/mod.rs
+++ b/src/unix/mod.rs
@@ -226,8 +226,12 @@ pub const S_ISUID: ::mode_t = 0x800;
pub const S_ISGID: ::mode_t = 0x400;
pub const S_ISVTX: ::mode_t = 0x200;
-pub const IF_NAMESIZE: ::size_t = 16;
-pub const IFNAMSIZ: ::size_t = IF_NAMESIZE;
+cfg_if! {
+ if #[cfg(not(any(target_os = "illumos", target_os = "solaris")))] {
+ pub const IF_NAMESIZE: ::size_t = 16;
+ pub const IFNAMSIZ: ::size_t = IF_NAMESIZE;
+ }
+}
pub const LOG_EMERG: ::c_int = 0;
pub const LOG_ALERT: ::c_int = 1;
@@ -612,7 +616,6 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "listen$UNIX2003"
)]
- #[cfg_attr(target_os = "illumos", link_name = "__xnet_listen")]
pub fn listen(socket: ::c_int, backlog: ::c_int) -> ::c_int;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
@@ -855,6 +858,7 @@ extern "C" {
pub fn geteuid() -> uid_t;
pub fn getgid() -> gid_t;
pub fn getgroups(ngroups_max: ::c_int, groups: *mut gid_t) -> ::c_int;
+ #[cfg_attr(target_os = "illumos", link_name = "getloginx")]
pub fn getlogin() -> *mut c_char;
#[cfg_attr(
all(target_os = "macos", target_arch = "x86"),
@@ -911,6 +915,7 @@ extern "C" {
all(target_os = "macos", target_arch = "x86"),
link_name = "ttyname_r$UNIX2003"
)]
+ #[cfg_attr(target_os = "illumos", link_name = "__posix_ttyname_r")]
pub fn ttyname_r(
fd: ::c_int,
buf: *mut c_char,
@@ -1217,6 +1222,7 @@ extern "C" {
pub fn dlclose(handle: *mut ::c_void) -> ::c_int;
pub fn dladdr(addr: *const ::c_void, info: *mut Dl_info) -> ::c_int;
+ #[cfg_attr(target_os = "illumos", link_name = "__xnet_getaddrinfo")]
pub fn getaddrinfo(
node: *const c_char,
service: *const c_char,