Skip to content

Commit

Permalink
Rollup merge of rust-lang#102227 - devnexen:solarish_get_path, r=m-ou-se
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Dylan-DPC authored Oct 11, 2022
2 parents 3f4b987 + 2ea770d commit 16914c9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions library/std/src/sys/unix/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 16914c9

Please sign in to comment.