@@ -22,16 +22,12 @@ use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
2222
2323#[ cfg( any( all( target_os = "linux" , target_env = "gnu" ) , target_vendor = "apple" ) ) ]
2424use crate :: sys:: weak:: syscall;
25- #[ cfg( any ( target_os = "android" , target_os = "macos" , target_os = "solaris" ) ) ]
25+ #[ cfg( target_os = "android" ) ]
2626use crate :: sys:: weak:: weak;
2727
2828use libc:: { c_int, mode_t} ;
2929
30- #[ cfg( any(
31- target_os = "solaris" ,
32- all( target_os = "linux" , target_env = "gnu" ) ,
33- target_vendor = "apple" ,
34- ) ) ]
30+ #[ cfg( any( all( target_os = "linux" , target_env = "gnu" ) , target_vendor = "apple" ) ) ]
3531use libc:: c_char;
3632#[ cfg( any(
3733 all( target_os = "linux" , not( target_env = "musl" ) ) ,
@@ -1753,19 +1749,6 @@ pub fn link(original: &Path, link: &Path) -> io::Result<()> {
17531749 // Android has `linkat` on newer versions, but we happen to know `link`
17541750 // always has the correct behavior, so it's here as well.
17551751 cvt( unsafe { libc:: link( original. as_ptr( ) , link. as_ptr( ) ) } ) ?;
1756- } else if #[ cfg( any( target_os = "macos" , target_os = "solaris" ) ) ] {
1757- // MacOS (<=10.9) and Solaris 10 lack support for linkat while newer
1758- // versions have it. We want to use linkat if it is available, so we use weak!
1759- // to check. `linkat` is preferable to `link` because it gives us a flag to
1760- // specify how symlinks should be handled. We pass 0 as the flags argument,
1761- // meaning it shouldn't follow symlinks.
1762- weak!( fn linkat( c_int, * const c_char, c_int, * const c_char, c_int) -> c_int) ;
1763-
1764- if let Some ( f) = linkat. get( ) {
1765- cvt( unsafe { f( libc:: AT_FDCWD , original. as_ptr( ) , libc:: AT_FDCWD , link. as_ptr( ) , 0 ) } ) ?;
1766- } else {
1767- cvt( unsafe { libc:: link( original. as_ptr( ) , link. as_ptr( ) ) } ) ?;
1768- } ;
17691752 } else {
17701753 // Where we can, use `linkat` instead of `link`; see the comment above
17711754 // this one for details on why.
0 commit comments