1 use super::unsupported;
2 use crate::error::Error as StdError;
3 use crate::ffi::{OsStr, OsString};
6 use crate::marker::PhantomData;
7 use crate::path::{self, PathBuf};
9 pub fn errno() -> i32 {
13 pub fn error_string(_errno: i32) -> String {
14 "operation successful".to_string()
17 pub fn getcwd() -> io::Result<PathBuf> {
21 pub fn chdir(_: &path::Path) -> io::Result<()> {
25 pub struct SplitPaths<'a>(!, PhantomData<&'a ()>);
27 pub fn split_paths(_unparsed: &OsStr) -> SplitPaths<'_> {
31 impl<'a> Iterator for SplitPaths<'a> {
33 fn next(&mut self) -> Option<PathBuf> {
39 pub struct JoinPathsError;
41 pub fn join_paths<I, T>(_paths: I) -> Result<OsString, JoinPathsError>
43 I: Iterator<Item = T>,
49 impl fmt::Display for JoinPathsError {
50 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
51 "not supported on this platform yet".fmt(f)
55 impl StdError for JoinPathsError {
57 fn description(&self) -> &str {
58 "not supported on this platform yet"
62 pub fn current_exe() -> io::Result<PathBuf> {
68 impl Iterator for Env {
69 type Item = (OsString, OsString);
70 fn next(&mut self) -> Option<(OsString, OsString)> {
76 panic!("not supported on this platform")
79 pub fn getenv(_: &OsStr) -> Option<OsString> {
83 pub fn setenv(_: &OsStr, _: &OsStr) -> io::Result<()> {
84 Err(io::const_io_error!(io::ErrorKind::Unsupported, "cannot set env vars on this platform"))
87 pub fn unsetenv(_: &OsStr) -> io::Result<()> {
88 Err(io::const_io_error!(io::ErrorKind::Unsupported, "cannot unset env vars on this platform"))
91 pub fn temp_dir() -> PathBuf {
92 panic!("no filesystem on this platform")
95 pub fn home_dir() -> Option<PathBuf> {
99 pub fn exit(_code: i32) -> ! {
100 crate::intrinsics::abort()
103 pub fn getpid() -> u32 {
104 panic!("no pids on this platform")