mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-23 01:13:23 +00:00
Fix many error codes in pipes
This commit is contained in:
committed by
Tate, Hongliang Tian
parent
8e72451448
commit
39cd4420f2
@ -18,11 +18,11 @@ use crate::{
|
||||
/// The basic operations defined on a file
|
||||
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");
|
||||
return_errno_with_message!(Errno::EBADF, "the file is not valid for reading");
|
||||
}
|
||||
|
||||
fn write(&self, buf: &[u8]) -> Result<usize> {
|
||||
return_errno_with_message!(Errno::EINVAL, "write is not supported");
|
||||
return_errno_with_message!(Errno::EBADF, "the file is not valid for writing");
|
||||
}
|
||||
|
||||
/// Read at the given file offset.
|
||||
|
Reference in New Issue
Block a user