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