mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-28 03:43:23 +00:00
19 lines
399 B
Rust
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())
|
|
}
|
|
}
|