diff --git a/include/boost/process/v2/ext/impl/cwd.ipp b/include/boost/process/v2/ext/impl/cwd.ipp index a73dbbcd..8f828751 100644 --- a/include/boost/process/v2/ext/impl/cwd.ipp +++ b/include/boost/process/v2/ext/impl/cwd.ipp @@ -112,8 +112,15 @@ filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code filesystem::path cwd(boost::process::v2::pid_type pid, boost::system::error_code & ec) { +#if (defined(__linux__) || defined(__ANDROID__)) return filesystem::canonical( - filesystem::path("/proc") / std::to_string(pid) / "cwd", ec); + filesystem::path("/proc") / std::to_string(pid) / "cwd", ec + ); +#elif defined(__sun) + return fileystem::canonical( + filesystem::path("/proc") / std::to_string(pid) / "path/cwd", ec + ); +#endif } #elif defined(__FreeBSD__) diff --git a/include/boost/process/v2/ext/impl/exe.ipp b/include/boost/process/v2/ext/impl/exe.ipp index 8b5bd993..067e583e 100644 --- a/include/boost/process/v2/ext/impl/exe.ipp +++ b/include/boost/process/v2/ext/impl/exe.ipp @@ -133,7 +133,7 @@ filesystem::path exe(boost::process::v2::pid_type pid, boost::system::error_code ); #elif defined(__sun) return fileystem::canonical( - filesystem::path("/proc") / std::to_string(pid) / "path/a.out" + filesystem::path("/proc") / std::to_string(pid) / "path/a.out", ec ); #endif }