-
-
Notifications
You must be signed in to change notification settings - Fork 157
feat: add select and pselect6 syscall #1229
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
base: master
Are you sure you want to change the base?
Conversation
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.
Pull Request Overview
This PR implements new select
and pselect6
syscalls in the kernel, adds a user-space test application for select
, and exposes poll utilities required by the new syscalls.
- Introduce a simple
select
test program and its DADK build configuration - Implement
SysSelect
andSysPselect6
kernel handlers and register them - Expose
do_sys_poll
andpoll_select_set_timeout
as public helpers and enable thelet_chains
feature
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
user/dadk/config/test_select_0_1_1.toml | Add DADK config for the test_select application |
user/apps/test_select/main.c | Add user-space select demo utilizing eventfd |
user/apps/test_select/Makefile | Add build/install/clean targets for test_select |
kernel/src/lib.rs | Enable let_chains nightly feature for Rust patterns |
kernel/src/filesystem/vfs/syscall/sys_select.rs | Implement select syscall and its helper functions |
kernel/src/filesystem/vfs/syscall/sys_pselect6.rs | Implement pselect6 syscall wrapper |
kernel/src/filesystem/vfs/syscall/mod.rs | Register the new syscall modules |
kernel/src/filesystem/poll.rs | Make do_sys_poll and poll_select_set_timeout public |
Comments suppressed due to low confidence (2)
kernel/src/filesystem/vfs/syscall/sys_select.rs:62
- The call to
size_of::<PosixTimeval>()
requires an import ofcore::mem::size_of
; adduse core::mem::size_of;
at the top to avoid an unresolved name error.
size_of::<PosixTimeval>(),
kernel/src/filesystem/vfs/syscall/sys_pselect6.rs:30
- The call to
size_of::<SigSet>()
also needsuse core::mem::size_of;
imported to compile.
UserBufferReader::new(sigmask_ptr as *const SigSet, size_of::<SigSet>(), true)?;
2025.7.10更新 是进程拷贝信号处理程序的bug。busybox启动的时候设置了SIGCHLD的处理函数。结果fork的时候子进程错误的继承了这个值。但是其实子进程没这个信号处理函数。导致收到SIGCHLD信号的时候崩溃。 ![]() ![]() (原始评论)
|
好像这个信号处理函数还是有必要的?后面busybox一直在调用SYS_RT_SIGTIMEDWAIT好像就是没有接收到子进程的SIGCHLD信号? ![]() ![]() |
Signed-off-by: Godones <chenlinfeng25@outlook.com>
Signed-off-by: Godones <chenlinfeng25@outlook.com>
WARN: 测试程序无法运行!!! 子进程会出现页错误