Skip to content

Commit 51320b3

Browse files
authored
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.
2 parents d13f7ae + 2ea770d commit 51320b3

File tree

1 file changed

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

1 file changed

+9
-2
lines changed

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

+9-2
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,12 @@ impl FromRawFd for File {
11721172

11731173
impl fmt::Debug for File {
11741174
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
1175-
#[cfg(any(target_os = "linux", target_os = "netbsd"))]
1175+
#[cfg(any(
1176+
target_os = "linux",
1177+
target_os = "netbsd",
1178+
target_os = "illumos",
1179+
target_os = "solaris"
1180+
))]
11761181
fn get_path(fd: c_int) -> Option<PathBuf> {
11771182
let mut p = PathBuf::from("/proc/self/fd");
11781183
p.push(&fd.to_string());
@@ -1227,7 +1232,9 @@ impl fmt::Debug for File {
12271232
target_os = "macos",
12281233
target_os = "vxworks",
12291234
all(target_os = "freebsd", target_arch = "x86_64"),
1230-
target_os = "netbsd"
1235+
target_os = "netbsd",
1236+
target_os = "illumos",
1237+
target_os = "solaris"
12311238
)))]
12321239
fn get_path(_fd: c_int) -> Option<PathBuf> {
12331240
// FIXME(#24570): implement this for other Unix platforms

0 commit comments

Comments
 (0)