rust/library/std
Dylan DPC 41134be153
Rollup merge of #78026 - sunfishcode:symlink-hard-link, r=dtolnay
Define `fs::hard_link` to not follow symlinks.

POSIX leaves it [implementation-defined] whether `link` follows symlinks.
In practice, for example, on Linux it does not and on FreeBSD it does.
So, switch to `linkat`, so that we can pick a behavior rather than
depending on OS defaults.

Pick the option to not follow symlinks. This is somewhat arbitrary, but
seems the less surprising choice because hard linking is a very
low-level feature which requires the source and destination to be on
the same mounted filesystem, and following a symbolic link could end
up in a different mounted filesystem.

[implementation-defined]: https://pubs.opengroup.org/onlinepubs/9699919799/functions/link.html
2020-11-09 01:13:28 +01:00
..
benches mv std libs to library/ 2020-07-27 19:51:13 -05:00
src Rollup merge of #78026 - sunfishcode:symlink-hard-link, r=dtolnay 2020-11-09 01:13:28 +01:00
tests mv std libs to library/ 2020-07-27 19:51:13 -05:00
build.rs Remove duplicated library links between std and libc 2020-09-21 01:37:15 -07:00
Cargo.toml Rollup merge of #77703 - Keruspe:system-libunwind, r=Mark-Simulacrum 2020-10-27 08:44:44 +09:00