feat(vfs): 实现 SYS_PWRITEV 系统调用#1322
Merged
fslongjin merged 4 commits intoDragonOS-Community:masterfrom Nov 6, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
Closed
Member
|
要格式化代码 |
8431715 to
d03ccbb
Compare
Member
|
看看这俩测例,在有了这个pr之后,能不能通过测试? 测例代码 |
Contributor
Author
|
Ok,预计下周找个时间使用 gVisor测试一下。最近几天有别的事情。 |
Contributor
Author
d03ccbb to
cf0ba0e
Compare
Member
|
可是,pwritev应该是去看pwritev_test吧 |
Contributor
Author
Collaborator
|
可以去cnb看看测例内容 |
Member
|
这里为什么要改为4gb? 原本的2gb应该是很空余的 |
00881e9 to
c9ac35b
Compare
- WriteTest.PartialWriteSIGSEGV 的报错是 x86_64::mm 模块 pagefault 处理模块引起的。 - WriteTest.PartialWriteSIGBUS 的报错是 mm 模块 pagefault 处理模块引起的。
c9ac35b to
7731e07
Compare
…scall-SYS_PWRITEV
fslongjin
approved these changes
Nov 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.