-
-
Notifications
You must be signed in to change notification settings - Fork 168
feat(vfs): 实现 SYS_PWRITEV 系统调用 #1322
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
feat(vfs): 实现 SYS_PWRITEV 系统调用 #1322
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 the SYS_PWRITEV system call for vectorized positional writing to files in the VFS (Virtual File System).
- Implements the SYS_PWRITEV system call that allows writing from multiple buffers to a file at a specified offset
- Adds comprehensive C unit tests covering basic functionality, edge cases, and error handling
- Integrates the new system call into the VFS module structure
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| user/apps/c_unitest/test_pwritev.c | Complete test suite with 6 test cases covering basic pwritev functionality, EOF scenarios, error handling, and offset preservation |
| kernel/src/filesystem/vfs/syscall/sys_pwritev.rs | Implementation of SysPwriteVHandle struct with system call handling and do_pwritev function |
| kernel/src/filesystem/vfs/syscall/mod.rs | Module declaration to include the new pwritev system call |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
要格式化代码 |
8431715 to
d03ccbb
Compare
|
看看这俩测例,在有了这个pr之后,能不能通过测试? 测例代码 |
|
Ok,预计下周找个时间使用 gVisor测试一下。最近几天有别的事情。 |
d03ccbb to
cf0ba0e
Compare
|
可是,pwritev应该是去看pwritev_test吧 |
|
可以去cnb看看测例内容 |
|
这里为什么要改为4gb? 原本的2gb应该是很空余的 |
00881e9 to
c9ac35b
Compare
- WriteTest.PartialWriteSIGSEGV 的报错是 x86_64::mm 模块 pagefault 处理模块引起的。 - WriteTest.PartialWriteSIGBUS 的报错是 mm 模块 pagefault 处理模块引起的。
c9ac35b to
7731e07
Compare
…scall-SYS_PWRITEV



Note
Implements
SYS_PWRITEV(vectorized positional write) and updates gVisor write test blocklist annotations.sys_pwritev: Add handlerSysPwriteVHandleto read userIoVecs, gather buffers, and perform positional writes viado_pwritev->file.pwrite.mod sys_pwritevinvfs/syscall/mod.rsanddeclare_syscall!(SYS_PWRITEV, ...).user/apps/tests/syscall/gvisor/blocklists/write_testwith entries/comments for failing write-related cases and kernel error notes.Written by Cursor Bugbot for commit ff8e812. This will update automatically on new commits. Configure here.