Skip to content
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

Closed

Conversation

ccrysisa
Copy link
Contributor

No description provided.


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;
Copy link
Member

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> {
Copy link
Member

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,
Copy link
Member

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

????没有这个函数啊,用Processmanager的current pcb

@fslongjin
Copy link
Member

笑死,跟老哥沟通了,这段时间重新开一个pr,这个数据结构有点老

@fslongjin fslongjin closed this Nov 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants