Files
asterinas/services/libs/aster-std/src/fs/procfs/self_.rs
2024-01-18 08:22:58 +08:00

19 lines
399 B
Rust

// SPDX-License-Identifier: MPL-2.0
use super::*;
/// Represents the inode at `/proc/self`.
pub struct SelfSymOps;
impl SelfSymOps {
pub fn new_inode(parent: Weak<dyn Inode>) -> Arc<dyn Inode> {
ProcSymBuilder::new(Self).parent(parent).build().unwrap()
}
}
impl SymOps for SelfSymOps {
fn read_link(&self) -> Result<String> {
Ok(current!().pid().to_string())
}
}