Most of this was generated by the absolutely extraordinary `cargo fix` subcommand. There were still 2 errors and a few warnings to patch up, but compared to the normal 600+ errors, I'd say the fixer did a damn good job! I'm also amazed that I could still start the VM after this, I half expected some kinds of runtime failure...
17 lines
430 B
Rust
17 lines
430 B
Rust
use alloc::vec::Vec;
|
|
|
|
use crate::context;
|
|
use crate::syscall::error::{Error, ESRCH, Result};
|
|
|
|
pub fn resource() -> Result<Vec<u8>> {
|
|
let mut name = {
|
|
let contexts = context::contexts();
|
|
let context_lock = contexts.current().ok_or(Error::new(ESRCH))?;
|
|
let context = context_lock.read();
|
|
let name = context.name.lock();
|
|
name.clone().into_vec()
|
|
};
|
|
name.push(b'\n');
|
|
Ok(name)
|
|
}
|