Skip to content

Commit 677b386

Browse files
committed
std::unix::fs::link using direct linkat call for Solaris.
Since we support solaris 11 as minimum, we can get rid of the runtime overhead.
1 parent 1d43fbb commit 677b386

File tree

1 file changed

+2
-2
lines changed
  • library/std/src/sys/pal/unix

1 file changed

+2
-2
lines changed

library/std/src/sys/pal/unix/fs.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1753,8 +1753,8 @@ pub fn link(original: &Path, link: &Path) -> io::Result<()> {
17531753
// Android has `linkat` on newer versions, but we happen to know `link`
17541754
// always has the correct behavior, so it's here as well.
17551755
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
1756+
} else if #[cfg(any(target_os = "macos"))] {
1757+
// MacOS (<=10.9) lacks support for linkat while newer
17581758
// versions have it. We want to use linkat if it is available, so we use weak!
17591759
// to check. `linkat` is preferable to `link` because it gives us a flag to
17601760
// specify how symlinks should be handled. We pass 0 as the flags argument,

0 commit comments

Comments
 (0)