@@ -349,6 +349,10 @@ cfg_if! {
349
349
// to "pthread" needs to be added.
350
350
#[ link( name = "pthread" ) ]
351
351
extern { }
352
+ } else if #[ cfg( target_env = "illumos" ) ] {
353
+ #[ link( name = "c" ) ]
354
+ #[ link( name = "m" ) ]
355
+ extern { }
352
356
} else {
353
357
#[ link( name = "c" ) ]
354
358
#[ link( name = "m" ) ]
@@ -519,13 +523,16 @@ extern {
519
523
pub fn putchar_unlocked ( c : :: c_int ) -> :: c_int ;
520
524
521
525
#[ cfg_attr( target_os = "netbsd" , link_name = "__socket30" ) ]
526
+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_socket" ) ]
522
527
pub fn socket ( domain : :: c_int , ty : :: c_int , protocol : :: c_int ) -> :: c_int ;
523
528
#[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
524
529
link_name = "connect$UNIX2003" ) ]
530
+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_connect" ) ]
525
531
pub fn connect ( socket : :: c_int , address : * const sockaddr ,
526
532
len : socklen_t ) -> :: c_int ;
527
533
#[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
528
534
link_name = "listen$UNIX2003" ) ]
535
+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_listen" ) ]
529
536
pub fn listen ( socket : :: c_int , backlog : :: c_int ) -> :: c_int ;
530
537
#[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
531
538
link_name = "accept$UNIX2003" ) ]
@@ -544,10 +551,12 @@ extern {
544
551
option_len : socklen_t ) -> :: c_int ;
545
552
#[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
546
553
link_name = "socketpair$UNIX2003" ) ]
554
+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_socketpair" ) ]
547
555
pub fn socketpair ( domain : :: c_int , type_ : :: c_int , protocol : :: c_int ,
548
556
socket_vector : * mut :: c_int ) -> :: c_int ;
549
557
#[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
550
558
link_name = "sendto$UNIX2003" ) ]
559
+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_sendto" ) ]
551
560
pub fn sendto ( socket : :: c_int , buf : * const :: c_void , len : :: size_t ,
552
561
flags : :: c_int , addr : * const sockaddr ,
553
562
addrlen : socklen_t ) -> :: ssize_t ;
@@ -607,7 +616,8 @@ extern {
607
616
pub fn readdir ( dirp : * mut :: DIR ) -> * mut :: dirent ;
608
617
#[ cfg_attr( target_os = "macos" , link_name = "readdir_r$INODE64" ) ]
609
618
#[ cfg_attr( target_os = "netbsd" , link_name = "__readdir_r30" ) ]
610
- #[ cfg_attr( target_os = "solaris" , link_name = "__posix_readdir_r" ) ]
619
+ #[ cfg_attr( any( target_os = "solaris" , target_os = "illumos" ) ,
620
+ link_name = "__posix_readdir_r" ) ]
611
621
#[ cfg_attr( target_os = "freebsd" , link_name = "readdir_r@FBSD_1.0" ) ]
612
622
pub fn readdir_r ( dirp : * mut :: DIR , entry : * mut :: dirent ,
613
623
result : * mut * mut :: dirent ) -> :: c_int ;
@@ -916,6 +926,7 @@ extern {
916
926
pub fn strerror_r ( errnum : :: c_int , buf : * mut c_char ,
917
927
buflen : :: size_t ) -> :: c_int ;
918
928
929
+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_getsockopt" ) ]
919
930
pub fn getsockopt ( sockfd : :: c_int ,
920
931
level : :: c_int ,
921
932
optname : :: c_int ,
@@ -1080,9 +1091,11 @@ extern {
1080
1091
pub fn tcdrain ( fd : :: c_int ) -> :: c_int ;
1081
1092
pub fn cfgetispeed ( termios : * const :: termios ) -> :: speed_t ;
1082
1093
pub fn cfgetospeed ( termios : * const :: termios ) -> :: speed_t ;
1094
+ #[ cfg( not( any( target_os = "solaris" , target_os = "illumos" ) ) ) ]
1083
1095
pub fn cfmakeraw ( termios : * mut :: termios ) ;
1084
1096
pub fn cfsetispeed ( termios : * mut :: termios , speed : :: speed_t ) -> :: c_int ;
1085
1097
pub fn cfsetospeed ( termios : * mut :: termios , speed : :: speed_t ) -> :: c_int ;
1098
+ #[ cfg( not( any( target_os = "solaris" , target_os = "illumos" ) ) ) ]
1086
1099
pub fn cfsetspeed ( termios : * mut :: termios , speed : :: speed_t ) -> :: c_int ;
1087
1100
pub fn tcgetattr ( fd : :: c_int , termios : * mut :: termios ) -> :: c_int ;
1088
1101
pub fn tcsetattr ( fd : :: c_int ,
@@ -1137,9 +1150,10 @@ cfg_if! {
1137
1150
target_os = "bitrig" ) ) ] {
1138
1151
mod bsd;
1139
1152
pub use self :: bsd:: * ;
1140
- } else if #[ cfg( target_os = "solaris" ) ] {
1141
- mod solaris;
1142
- pub use self :: solaris:: * ;
1153
+ } else if #[ cfg( any( target_os = "solaris" ,
1154
+ target_os = "illumos" ) ) ] {
1155
+ mod solarish;
1156
+ pub use self :: solarish:: * ;
1143
1157
} else if #[ cfg( target_os = "haiku" ) ] {
1144
1158
mod haiku;
1145
1159
pub use self :: haiku:: * ;
0 commit comments