Avoid duplicate wait_events methods

This commit is contained in:
Ruihan Li
2024-06-30 22:38:28 +08:00
committed by Tate, Hongliang Tian
parent 6e8896165d
commit ab9941263b
11 changed files with 126 additions and 134 deletions

View File

@ -12,11 +12,11 @@ use crate::{
},
net::socket::Socket,
prelude::*,
process::{signal::Poller, Gid, Uid},
process::{signal::Pollable, Gid, Uid},
};
/// The basic operations defined on a file
pub trait FileLike: Send + Sync + Any {
pub trait FileLike: Pollable + Send + Sync + Any {
fn read(&self, buf: &mut [u8]) -> Result<usize> {
return_errno_with_message!(Errno::EINVAL, "read is not supported");
}
@ -50,10 +50,6 @@ pub trait FileLike: Send + Sync + Any {
return_errno_with_message!(Errno::EINVAL, "ioctl is not supported");
}
fn poll(&self, _mask: IoEvents, _poller: Option<&Poller>) -> IoEvents {
IoEvents::empty()
}
fn resize(&self, new_size: usize) -> Result<()> {
return_errno_with_message!(Errno::EINVAL, "resize is not supported");
}