diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2022-10-11 18:59:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-10-11 18:59:47 +0200 |
| commit | 51320b3a16d2fd3e153b122a38ad04ae8ef92963 (patch) | |
| tree | bd7669540959bda212ee63fc64814e88377e0d7e /library/std/src/sys/unix/fs.rs | |
| parent | d13f7aef7042dbb37be17b30a2f048dc0ed56f82 (diff) | |
| parent | 2ea770d067b186dac4be6fe22757efc8f8176eb2 (diff) | |
| download | rust-51320b3a16d2fd3e153b122a38ad04ae8ef92963.tar.gz rust-51320b3a16d2fd3e153b122a38ad04ae8ef92963.zip | |
Rollup merge of #102227 - devnexen:solarish_get_path, r=m-ou-se
fs::get_path solarish version. similar to linux, albeit there is no /proc/self notion on solaris based system thus flattening the difference for simplification sake.
Diffstat (limited to 'library/std/src/sys/unix/fs.rs')
| -rw-r--r-- | library/std/src/sys/unix/fs.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs index 7bb4b0a9c79..3ac01e6a27d 100644 --- a/library/std/src/sys/unix/fs.rs +++ b/library/std/src/sys/unix/fs.rs @@ -1172,7 +1172,12 @@ impl FromRawFd for File { impl fmt::Debug for File { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - #[cfg(any(target_os = "linux", target_os = "netbsd"))] + #[cfg(any( + target_os = "linux", + target_os = "netbsd", + target_os = "illumos", + target_os = "solaris" + ))] fn get_path(fd: c_int) -> Option<PathBuf> { let mut p = PathBuf::from("/proc/self/fd"); p.push(&fd.to_string()); @@ -1227,7 +1232,9 @@ impl fmt::Debug for File { target_os = "macos", target_os = "vxworks", all(target_os = "freebsd", target_arch = "x86_64"), - target_os = "netbsd" + target_os = "netbsd", + target_os = "illumos", + target_os = "solaris" )))] fn get_path(_fd: c_int) -> Option<PathBuf> { // FIXME(#24570): implement this for other Unix platforms |
