Skip to content

Commit 9811f3c

Browse files
committed
[Cargo]: update api to 0.2.7
1 parent 7782d0b commit 9811f3c

File tree

9 files changed

+22
-22
lines changed

9 files changed

+22
-22
lines changed

library/Cargo.lock

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,6 @@ dependencies = [
316316
[[package]]
317317
name = "safa-abi"
318318
version = "0.2.5"
319-
source = "registry+https://github.com/rust-lang/crates.io-index"
320-
checksum = "904cf96582683a0faecdaf07b75f1b12388f893722be8e3ffa81a4f671364bf1"
321319
dependencies = [
322320
"compiler_builtins",
323321
"rustc-std-workspace-alloc",
@@ -327,8 +325,6 @@ dependencies = [
327325
[[package]]
328326
name = "safa-api"
329327
version = "0.2.6"
330-
source = "registry+https://github.com/rust-lang/crates.io-index"
331-
checksum = "4f38596091b6f623631d7a960e7753c94bd51e21c4541c53fdcceb4e1abb1b55"
332328
dependencies = [
333329
"compiler_builtins",
334330
"rustc-std-workspace-alloc",

library/std/Cargo.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ hermit-abi = { version = "0.4.0", features = [
7777
], public = true }
7878

7979
[target.'cfg(target_os = "safaos")'.dependencies]
80-
safa-api = { version = "0.2.6", features = ['rustc-dep-of-std'], public = true }
80+
safa-api = { version = "0.2.7", features = [
81+
'rustc-dep-of-std',
82+
], public = true }
8183

8284
[target.'cfg(target_os = "wasi")'.dependencies]
8385
wasi = { version = "0.11.0", features = [

library/std/src/os/safaos/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#[unstable(feature = "rustc_private", issue = "27812")]
33
pub use safa_api as api;
44

5+
use safa_api::errors::ErrorStatus;
56
#[stable(feature = "safa_api", since = "1.0.0")]
67
pub use safa_api::*;
7-
use safa_api::errors::ErrorStatus;
88

99
#[inline(always)]
1010
pub(crate) fn into_io_error_kind(err: ErrorStatus) -> crate::io::ErrorKind {
@@ -18,9 +18,9 @@ pub(crate) fn into_io_error_kind(err: ErrorStatus) -> crate::io::ErrorKind {
1818
Busy => IoErrorKind::ResourceBusy,
1919
NotADirectory => IoErrorKind::NotADirectory,
2020
NotAFile => IoErrorKind::IsADirectory,
21-
InvaildPath => IoErrorKind::InvalidInput,
22-
InvaildStr => IoErrorKind::InvalidData,
21+
InvalidPath => IoErrorKind::InvalidInput,
22+
InvalidStr => IoErrorKind::InvalidData,
2323
OutOfMemory | MMapError => IoErrorKind::OutOfMemory,
2424
_ => IoErrorKind::Other,
2525
}
26-
}
26+
}

library/std/src/sys/pal/safaos/args.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use crate::ffi::OsString;
22
use crate::fmt;
33

4-
pub struct Args(safa_api::process::ArgsIter);
4+
pub struct Args(safa_api::process::args::ArgsIter);
55

66
pub fn args() -> Args {
7-
Args(safa_api::process::ArgsIter::get())
7+
Args(safa_api::process::args::ArgsIter::get())
88
}
99

1010
impl fmt::Debug for Args {

library/std/src/sys/pal/safaos/os.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ impl Iterator for Env {
111111
}
112112

113113
pub fn env() -> Env {
114-
let all = safa_api::process::env_get_all();
114+
let all = safa_api::process::env::env_get_all();
115115
let mut results = Vec::with_capacity(all.len());
116116
for (key, value) in all {
117117
results.push((unsafe { OsString::from_encoded_bytes_unchecked(key.to_vec()) }, unsafe {
@@ -123,17 +123,17 @@ pub fn env() -> Env {
123123
}
124124

125125
pub fn getenv(key: &OsStr) -> Option<OsString> {
126-
safa_api::process::env_get(key.as_encoded_bytes())
126+
safa_api::process::env::env_get(key.as_encoded_bytes())
127127
.map(|s| unsafe { OsString::from_encoded_bytes_unchecked(s.to_vec()) })
128128
}
129129

130130
pub unsafe fn setenv(key: &OsStr, value: &OsStr) -> io::Result<()> {
131-
safa_api::process::env_set(key.as_encoded_bytes(), value.as_encoded_bytes());
131+
safa_api::process::env::env_set(key.as_encoded_bytes(), value.as_encoded_bytes());
132132
Ok(())
133133
}
134134

135135
pub unsafe fn unsetenv(key: &OsStr) -> io::Result<()> {
136-
safa_api::process::env_remove(key.as_encoded_bytes());
136+
safa_api::process::env::env_remove(key.as_encoded_bytes());
137137
Ok(())
138138
}
139139

library/std/src/sys/pal/safaos/process.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::sys::pipe::AnonPipe;
99
use crate::sys_common::process::{CommandEnv, CommandEnvs};
1010
use crate::{fmt, io};
1111
use safa_api::errors::SysResult;
12-
use safa_api::process::{sysmeta_stderr, sysmeta_stdin, sysmeta_stdout};
12+
use safa_api::process::stdio::{sysmeta_stderr, sysmeta_stdin, sysmeta_stdout};
1313

1414
use super::resources::FileDesc;
1515

library/std/src/sys/pal/safaos/resources.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ impl io::Read for &FileDesc {
155155

156156
let read = match self.fd.read(*at, buf) {
157157
Ok(amount) => amount,
158-
Err(ErrorStatus::InvaildOffset) => return Ok(0),
158+
Err(ErrorStatus::InvalidOffset) => return Ok(0),
159159
Err(other) => return Err(other.into()),
160160
};
161161
*at += read as isize;
@@ -171,7 +171,7 @@ impl io::Write for &FileDesc {
171171

172172
let wrote = match self.fd.write(*at, buf) {
173173
Ok(amount) => amount,
174-
Err(ErrorStatus::InvaildOffset) => return Ok(0),
174+
Err(ErrorStatus::InvalidOffset) => return Ok(0),
175175
Err(other) => return Err(other.into()),
176176
};
177177
*at += wrote as isize;

library/std/src/sys/pal/safaos/start.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use safa_api::raw::processes::AbiStructures;
12
use safa_api::raw::{NonNullSlice, RawSliceMut};
23
use safa_api::syscalls::exit;
34

@@ -10,11 +11,12 @@ unsafe fn _start_inner(
1011
argv: *mut NonNullSlice<u8>,
1112
envc: usize,
1213
envp: *mut NonNullSlice<u8>,
14+
task_abi_structures: *const AbiStructures,
1315
) -> ! {
1416
unsafe {
1517
let args = RawSliceMut::from_raw_parts(argv, argc);
1618
let env = RawSliceMut::from_raw_parts(envp, envc);
17-
safa_api::process::sysapi_init(args, env);
19+
safa_api::process::init::sysapi_init(args, env, *task_abi_structures);
1820
let results = main();
1921

2022
exit(results as usize);
@@ -28,6 +30,7 @@ pub extern "C" fn _start(
2830
argv: *mut NonNullSlice<u8>,
2931
envc: usize,
3032
envp: *mut NonNullSlice<u8>,
33+
task_abi_structures: *const AbiStructures,
3134
) {
3235
unsafe {
3336
core::arch::asm!(
@@ -36,8 +39,7 @@ pub extern "C" fn _start(
3639
push rbp
3740
push rbp
3841
",
39-
options(nostack)
4042
);
41-
_start_inner(argc, argv, envc, envp);
43+
_start_inner(argc, argv, envc, envp, task_abi_structures);
4244
};
4345
}

library/std/src/sys/pal/safaos/stdio.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::io;
22
use crate::os::safaos::api::errors::ErrorStatus;
3-
use safa_api::process::{sysmeta_stderr, sysmeta_stdin, sysmeta_stdout};
3+
use safa_api::process::stdio::{sysmeta_stderr, sysmeta_stdin, sysmeta_stdout};
44
use safa_api::syscalls;
55
#[stable(feature = "stdio", since = "1.0.0")]
66
impl From<ErrorStatus> for io::Error {

0 commit comments

Comments
 (0)