Limit libc::link usage to nto70 target only, not NTO OS · qinheping/verify-rust-std@e977a44 (original) (raw)

`@@ -1731,7 +1731,7 @@ pub fn link(original: &Path, link: &Path) -> io::Result<()> {

`

1731

1731

`run_path_with_cstr(original, &|original| {

`

1732

1732

`run_path_with_cstr(link, &|link| {

`

1733

1733

` cfg_if::cfg_if! {

`

1734

``

`-

if #[cfg(any(target_os = "vxworks", target_os = "redox", target_os = "android", target_os = "espidf", target_os = "horizon", target_os = "vita", target_os = "nto"))] {

`

``

1734

`+

if #[cfg(any(target_os = "vxworks", target_os = "redox", target_os = "android", target_os = "espidf", target_os = "horizon", target_os = "vita", target_env = "nto70"))] {

`

1735

1735

`` // VxWorks, Redox and ESP-IDF lack linkat, so use link instead. POSIX leaves

``

1736

1736

`` // it implementation-defined whether link follows symlinks, so rely on the

``

1737

1737

`` // symlink_hard_link test in library/std/src/fs/tests.rs to check the behavior.

``