Skip to content

Commit

Permalink
zkvm: remove cmath and fix os_str
Browse files Browse the repository at this point in the history
  • Loading branch information
SchmErik committed Jun 21, 2024
1 parent 04520a4 commit b6c404a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion library/std/src/sys/pal/zkvm/args.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use super::{abi, WORD_SIZE};
use crate::ffi::OsString;
use crate::fmt;
use crate::sys::os_str;
use crate::sys_common::FromInner;

pub struct Args {
Expand Down Expand Up @@ -33,7 +34,7 @@ impl Args {
// "os_str".
let arg_bytes: &[u8] =
unsafe { crate::slice::from_raw_parts(words.cast() as *const u8, arg_len) };
OsString::from_inner(super::os_str::Buf { inner: arg_bytes.to_vec() })
OsString::from_inner(os_str::Buf { inner: arg_bytes.to_vec() })
}
}

Expand Down
2 changes: 0 additions & 2 deletions library/std/src/sys/pal/zkvm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ const WORD_SIZE: usize = core::mem::size_of::<u32>();
pub mod alloc;
#[path = "../zkvm/args.rs"]
pub mod args;
#[path = "../unix/cmath.rs"]
pub mod cmath;
pub mod env;
#[path = "../unsupported/fs.rs"]
pub mod fs;
Expand Down
3 changes: 2 additions & 1 deletion library/std/src/sys/pal/zkvm/os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::fmt;
use crate::io;
use crate::marker::PhantomData;
use crate::path::{self, PathBuf};
use crate::sys::os_str;
use crate::sys_common::FromInner;

pub fn errno() -> i32 {
Expand Down Expand Up @@ -111,7 +112,7 @@ pub fn getenv(varname: &OsStr) -> Option<OsString> {
// reimplement "os_str" instead of just using the generic unix
// "os_str".
let u8s: &[u8] = unsafe { crate::slice::from_raw_parts(words.cast() as *const u8, nbytes) };
Some(OsString::from_inner(super::os_str::Buf { inner: u8s.to_vec() }))
Some(OsString::from_inner(os_str::Buf { inner: u8s.to_vec() }))
}

pub fn setenv(_: &OsStr, _: &OsStr) -> io::Result<()> {
Expand Down

0 comments on commit b6c404a

Please sign in to comment.