@@ -349,6 +349,10 @@ cfg_if! {
349349 // to "pthread" needs to be added.
350350 #[ link( name = "pthread" ) ]
351351 extern { }
352+ } else if #[ cfg( target_env = "illumos" ) ] {
353+ #[ link( name = "c" ) ]
354+ #[ link( name = "m" ) ]
355+ extern { }
352356 } else {
353357 #[ link( name = "c" ) ]
354358 #[ link( name = "m" ) ]
@@ -519,13 +523,16 @@ extern {
519523 pub fn putchar_unlocked ( c : :: c_int ) -> :: c_int ;
520524
521525 #[ cfg_attr( target_os = "netbsd" , link_name = "__socket30" ) ]
526+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_socket" ) ]
522527 pub fn socket ( domain : :: c_int , ty : :: c_int , protocol : :: c_int ) -> :: c_int ;
523528 #[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
524529 link_name = "connect$UNIX2003" ) ]
530+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_connect" ) ]
525531 pub fn connect ( socket : :: c_int , address : * const sockaddr ,
526532 len : socklen_t ) -> :: c_int ;
527533 #[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
528534 link_name = "listen$UNIX2003" ) ]
535+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_listen" ) ]
529536 pub fn listen ( socket : :: c_int , backlog : :: c_int ) -> :: c_int ;
530537 #[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
531538 link_name = "accept$UNIX2003" ) ]
@@ -544,10 +551,12 @@ extern {
544551 option_len : socklen_t ) -> :: c_int ;
545552 #[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
546553 link_name = "socketpair$UNIX2003" ) ]
554+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_socketpair" ) ]
547555 pub fn socketpair ( domain : :: c_int , type_ : :: c_int , protocol : :: c_int ,
548556 socket_vector : * mut :: c_int ) -> :: c_int ;
549557 #[ cfg_attr( all( target_os = "macos" , target_arch = "x86" ) ,
550558 link_name = "sendto$UNIX2003" ) ]
559+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_sendto" ) ]
551560 pub fn sendto ( socket : :: c_int , buf : * const :: c_void , len : :: size_t ,
552561 flags : :: c_int , addr : * const sockaddr ,
553562 addrlen : socklen_t ) -> :: ssize_t ;
@@ -607,7 +616,8 @@ extern {
607616 pub fn readdir ( dirp : * mut :: DIR ) -> * mut :: dirent ;
608617 #[ cfg_attr( target_os = "macos" , link_name = "readdir_r$INODE64" ) ]
609618 #[ 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" ) ]
611621 #[ cfg_attr( target_os = "freebsd" , link_name = "readdir_r@FBSD_1.0" ) ]
612622 pub fn readdir_r ( dirp : * mut :: DIR , entry : * mut :: dirent ,
613623 result : * mut * mut :: dirent ) -> :: c_int ;
@@ -916,6 +926,7 @@ extern {
916926 pub fn strerror_r ( errnum : :: c_int , buf : * mut c_char ,
917927 buflen : :: size_t ) -> :: c_int ;
918928
929+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_getsockopt" ) ]
919930 pub fn getsockopt ( sockfd : :: c_int ,
920931 level : :: c_int ,
921932 optname : :: c_int ,
@@ -1080,10 +1091,8 @@ extern {
10801091 pub fn tcdrain ( fd : :: c_int ) -> :: c_int ;
10811092 pub fn cfgetispeed ( termios : * const :: termios ) -> :: speed_t ;
10821093 pub fn cfgetospeed ( termios : * const :: termios ) -> :: speed_t ;
1083- pub fn cfmakeraw ( termios : * mut :: termios ) ;
10841094 pub fn cfsetispeed ( termios : * mut :: termios , speed : :: speed_t ) -> :: c_int ;
10851095 pub fn cfsetospeed ( termios : * mut :: termios , speed : :: speed_t ) -> :: c_int ;
1086- pub fn cfsetspeed ( termios : * mut :: termios , speed : :: speed_t ) -> :: c_int ;
10871096 pub fn tcgetattr ( fd : :: c_int , termios : * mut :: termios ) -> :: c_int ;
10881097 pub fn tcsetattr ( fd : :: c_int ,
10891098 optional_actions : :: c_int ,
@@ -1116,6 +1125,16 @@ extern {
11161125 stream : * mut FILE ) -> ssize_t ;
11171126}
11181127
1128+ cfg_if ! {
1129+ if #[ cfg( not( any( target_os = "solaris" , target_os = "illumos" ) ) ) ] {
1130+ extern {
1131+ pub fn cfmakeraw( termios: * mut :: termios) ;
1132+ pub fn cfsetspeed( termios: * mut :: termios,
1133+ speed: :: speed_t) -> :: c_int;
1134+ }
1135+ }
1136+ }
1137+
11191138cfg_if ! {
11201139 if #[ cfg( target_env = "uclibc" ) ] {
11211140 mod uclibc;
@@ -1137,9 +1156,10 @@ cfg_if! {
11371156 target_os = "bitrig" ) ) ] {
11381157 mod bsd;
11391158 pub use self :: bsd:: * ;
1140- } else if #[ cfg( target_os = "solaris" ) ] {
1141- mod solaris;
1142- pub use self :: solaris:: * ;
1159+ } else if #[ cfg( any( target_os = "solaris" ,
1160+ target_os = "illumos" ) ) ] {
1161+ mod solarish;
1162+ pub use self :: solarish:: * ;
11431163 } else if #[ cfg( target_os = "haiku" ) ] {
11441164 mod haiku;
11451165 pub use self :: haiku:: * ;
0 commit comments