新增SystemError枚举类型,使得错误处理更清晰 (#205)

This commit is contained in:
login
2023-03-18 20:26:05 +08:00
committed by GitHub
parent 0d48c3c9c2
commit 4454d1a2dd
6 changed files with 204 additions and 13 deletions

9
kernel/src/net/mod.rs Normal file
View File

@ -0,0 +1,9 @@
use core::fmt::Debug;
use crate::syscall::SystemError;
pub trait Socket: Sync + Send + Debug {
fn read(&self, buf: &mut [u8]) -> Result<usize, SystemError>;
fn write(&self, buf: &[u8]) -> Result<usize, SystemError>;
}