mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-24 01:43:22 +00:00
Reconstruct utime-like syscalls and fix filetime implementations
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
3de8a9330a
commit
5edc110f9d
@ -10,6 +10,7 @@ use crate::{
|
||||
events::{IoEvents, Observer},
|
||||
prelude::*,
|
||||
process::{signal::Poller, Gid, Uid},
|
||||
time::clocks::RealTimeCoarseClock,
|
||||
};
|
||||
|
||||
pub struct PipeReader {
|
||||
@ -44,15 +45,16 @@ impl FileLike for PipeReader {
|
||||
}
|
||||
|
||||
fn metadata(&self) -> Metadata {
|
||||
let now = RealTimeCoarseClock::get().read_time();
|
||||
Metadata {
|
||||
dev: 0,
|
||||
ino: 0,
|
||||
size: 0,
|
||||
blk_size: 0,
|
||||
blocks: 0,
|
||||
atime: Default::default(),
|
||||
mtime: Default::default(),
|
||||
ctime: Default::default(),
|
||||
atime: now,
|
||||
mtime: now,
|
||||
ctime: now,
|
||||
type_: InodeType::NamedPipe,
|
||||
mode: InodeMode::from_bits_truncate(0o400),
|
||||
nlinks: 1,
|
||||
@ -110,15 +112,16 @@ impl FileLike for PipeWriter {
|
||||
}
|
||||
|
||||
fn metadata(&self) -> Metadata {
|
||||
let now = RealTimeCoarseClock::get().read_time();
|
||||
Metadata {
|
||||
dev: 0,
|
||||
ino: 0,
|
||||
size: 0,
|
||||
blk_size: 0,
|
||||
blocks: 0,
|
||||
atime: Default::default(),
|
||||
mtime: Default::default(),
|
||||
ctime: Default::default(),
|
||||
atime: now,
|
||||
mtime: now,
|
||||
ctime: now,
|
||||
type_: InodeType::NamedPipe,
|
||||
mode: InodeMode::from_bits_truncate(0o200),
|
||||
nlinks: 1,
|
||||
|
Reference in New Issue
Block a user