std/sys/pal/unsupported/
os.rs1use super::unsupported;
2use crate::ffi::{OsStr, OsString};
3use crate::marker::PhantomData;
4use crate::path::{self, PathBuf};
5use crate::{fmt, io};
6
7pub fn getcwd() -> io::Result<PathBuf> {
8 unsupported()
9}
10
11pub fn chdir(_: &path::Path) -> io::Result<()> {
12 unsupported()
13}
14
15pub struct SplitPaths<'a>(!, PhantomData<&'a ()>);
16
17pub fn split_paths(_unparsed: &OsStr) -> SplitPaths<'_> {
18 panic!("unsupported")
19}
20
21impl<'a> Iterator for SplitPaths<'a> {
22 type Item = PathBuf;
23 fn next(&mut self) -> Option<PathBuf> {
24 self.0
25 }
26}
27
28#[derive(Debug)]
29pub struct JoinPathsError;
30
31pub fn join_paths<I, T>(_paths: I) -> Result<OsString, JoinPathsError>
32where
33 I: Iterator<Item = T>,
34 T: AsRef<OsStr>,
35{
36 Err(JoinPathsError)
37}
38
39impl fmt::Display for JoinPathsError {
40 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
41 "not supported on this platform yet".fmt(f)
42 }
43}
44
45impl crate::error::Error for JoinPathsError {}
46
47pub fn current_exe() -> io::Result<PathBuf> {
48 unsupported()
49}
50
51pub fn temp_dir() -> PathBuf {
52 panic!("no filesystem on this platform")
53}
54
55pub fn home_dir() -> Option<PathBuf> {
56 None
57}
58
59pub fn exit(_code: i32) -> ! {
60 crate::intrinsics::abort()
61}
62
63pub fn getpid() -> u32 {
64 panic!("no pids on this platform")
65}