-
-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Patch select and poll #337
Patch select and poll #337
Conversation
|
||
const FD_SET_SIZE: usize = 1024; | ||
const FD_SET_IDX_MASK: usize = 8 * core::mem::size_of::<u64>(); | ||
const FD_SET_BIT_MASK: usize = FD_SET_IDX_MASK - 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加注释
} | ||
|
||
/// @brief 在内核和用户空间之间进行 fd_set 的复制 | ||
fn copy_fd_set(src: *const FdSet, dst: *mut FdSet, op: CopyOp) -> Result<(), SystemError> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
使用UserBuffer结构体,不允许这样裸指针拷贝。
use crate::{ | ||
arch::asm::current::current_pcb, | ||
filesystem::vfs::PollStatus, | ||
include::bindings::bindings::PROC_MAX_FD_NUM, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用FileDescriptorVec的那个const值。
use alloc::vec::Vec; | ||
|
||
use crate::{ | ||
arch::asm::current::current_pcb, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
????没有这个函数啊,用Processmanager的current pcb
笑死,跟老哥沟通了,这段时间重新开一个pr,这个数据结构有点老 |
No description provided.