add platform-specific function to get the error number for HermitOS
Extending `std` to get the last error number for HermitOS. HermitOS is a tier 3 platform and this PR changes only files, wich are related to the tier 3 platform.
This commit is contained in:
@@ -14,15 +14,15 @@ use crate::sys::unsupported;
|
||||
use crate::vec;
|
||||
|
||||
pub fn errno() -> i32 {
|
||||
0
|
||||
unsafe { abi::get_errno() }
|
||||
}
|
||||
|
||||
pub fn error_string(_errno: i32) -> String {
|
||||
"operation successful".to_string()
|
||||
pub fn error_string(errno: i32) -> String {
|
||||
abi::error_string(errno).to_string()
|
||||
}
|
||||
|
||||
pub fn getcwd() -> io::Result<PathBuf> {
|
||||
unsupported()
|
||||
Ok(PathBuf::from("/"))
|
||||
}
|
||||
|
||||
pub fn chdir(_: &path::Path) -> io::Result<()> {
|
||||
@@ -188,7 +188,7 @@ pub fn unsetenv(k: &OsStr) -> io::Result<()> {
|
||||
}
|
||||
|
||||
pub fn temp_dir() -> PathBuf {
|
||||
panic!("no filesystem on hermit")
|
||||
PathBuf::from("/tmp")
|
||||
}
|
||||
|
||||
pub fn home_dir() -> Option<PathBuf> {
|
||||
|
||||
Reference in New Issue
Block a user