@@ -625,10 +625,8 @@ extern "C" {
625625
626626 #[ cfg( not( all( target_arch = "powerpc" , target_vendor = "nintendo" ) ) ) ]
627627 #[ cfg_attr( target_os = "netbsd" , link_name = "__socket30" ) ]
628- #[ cfg_attr(
629- any( target_os = "illumos" , target_os = "solaris" ) ,
630- link_name = "__xnet_socket"
631- ) ]
628+ #[ cfg_attr( target_os = "illumos" , link_name = "__xnet_socket" ) ]
629+ #[ cfg_attr( target_os = "solaris" , link_name = "__xnet7_socket" ) ]
632630 #[ cfg_attr( target_os = "espidf" , link_name = "lwip_socket" ) ]
633631 pub fn socket ( domain : :: c_int , ty : :: c_int , protocol : :: c_int ) -> :: c_int ;
634632 #[ cfg( not( all( target_arch = "powerpc" , target_vendor = "nintendo" ) ) ) ]
@@ -914,6 +912,7 @@ extern "C" {
914912 pub fn getppid ( ) -> pid_t ;
915913 pub fn getuid ( ) -> uid_t ;
916914 pub fn isatty ( fd : :: c_int ) -> :: c_int ;
915+ #[ cfg_attr( target_os = "solaris" , link_name = "__link_xpg4" ) ]
917916 pub fn link ( src : * const c_char , dst : * const c_char ) -> :: c_int ;
918917 pub fn lseek ( fd : :: c_int , offset : off_t , whence : :: c_int ) -> off_t ;
919918 pub fn pathconf ( path : * const c_char , name : :: c_int ) -> c_long ;
@@ -952,7 +951,10 @@ extern "C" {
952951 all( target_os = "macos" , target_arch = "x86" ) ,
953952 link_name = "ttyname_r$UNIX2003"
954953 ) ]
955- #[ cfg_attr( target_os = "illumos" , link_name = "__posix_ttyname_r" ) ]
954+ #[ cfg_attr(
955+ any( target_os = "illumos" , target_os = "solaris" ) ,
956+ link_name = "__posix_ttyname_r"
957+ ) ]
956958 pub fn ttyname_r ( fd : :: c_int , buf : * mut c_char , buflen : :: size_t ) -> :: c_int ;
957959 pub fn unlink ( c : * const c_char ) -> :: c_int ;
958960 #[ cfg_attr(
@@ -1073,8 +1075,6 @@ extern "C" {
10731075 ) ]
10741076 pub fn realpath ( pathname : * const :: c_char , resolved : * mut :: c_char ) -> * mut :: c_char ;
10751077
1076- pub fn flock ( fd : :: c_int , operation : :: c_int ) -> :: c_int ;
1077-
10781078 #[ cfg_attr( target_os = "netbsd" , link_name = "__times13" ) ]
10791079 pub fn times ( buf : * mut :: tms ) -> :: clock_t ;
10801080
@@ -1375,6 +1375,7 @@ extern "C" {
13751375 #[ cfg_attr( target_os = "netbsd" , link_name = "__sigpending14" ) ]
13761376 pub fn sigpending ( set : * mut sigset_t ) -> :: c_int ;
13771377
1378+ #[ cfg_attr( target_os = "solaris" , link_name = "__sysconf_xpg7" ) ]
13781379 pub fn sysconf ( name : :: c_int ) -> :: c_long ;
13791380
13801381 pub fn mkfifo ( path : * const c_char , mode : mode_t ) -> :: c_int ;
@@ -1445,10 +1446,15 @@ cfg_if! {
14451446 if #[ cfg( not( any( target_os = "emscripten" ,
14461447 target_os = "android" ,
14471448 target_os = "haiku" ,
1448- target_os = "nto" ) ) ) ] {
1449+ target_os = "nto" ,
1450+ target_os = "solaris" ) ) ) ] {
14491451 extern "C" {
14501452 pub fn adjtime( delta: * const timeval, olddelta: * mut timeval) -> :: c_int;
14511453 }
1454+ } else if #[ cfg( target_os = "solaris" ) ] {
1455+ extern "C" {
1456+ pub fn adjtime( delta: * mut timeval, olddelta: * mut timeval) -> :: c_int;
1457+ }
14521458 }
14531459}
14541460
@@ -1470,6 +1476,14 @@ cfg_if! {
14701476 }
14711477}
14721478
1479+ cfg_if ! {
1480+ if #[ cfg( not( target_os = "solaris" ) ) ] {
1481+ extern "C" {
1482+ pub fn flock( fd: :: c_int, operation: :: c_int) -> :: c_int;
1483+ }
1484+ }
1485+ }
1486+
14731487cfg_if ! {
14741488 if #[ cfg( not( any( target_env = "uclibc" , target_os = "nto" ) ) ) ] {
14751489 extern "C" {
0 commit comments