Skip to content

Commit 361c0e8

Browse files
authored
Add syscall sendfile (#867)
Support syscall [sendfile](https://man7.org/linux/man-pages/man2/sendfile.2.html)
1 parent 46edacb commit 361c0e8

4 files changed

Lines changed: 528 additions & 12 deletions

File tree

litebox_common_linux/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2067,6 +2067,12 @@ pub enum SyscallRequest<Platform: litebox::platform::RawPointerProvider> {
20672067
count: usize,
20682068
offset: i64,
20692069
},
2070+
Sendfile {
2071+
out_fd: i32,
2072+
in_fd: i32,
2073+
offset: Option<Platform::RawMutPointer<i64>>,
2074+
count: usize,
2075+
},
20702076
Readv {
20712077
fd: i32,
20722078
iovec: Platform::RawConstPointer<IoReadVec<Platform::RawMutPointer<u8>>>,
@@ -2585,6 +2591,7 @@ impl<Platform: litebox::platform::RawPointerProvider> SyscallRequest<Platform> {
25852591
count,
25862592
offset
25872593
}),
2594+
Sysno::sendfile => sys_req!(Sendfile { out_fd, in_fd, offset:*, count }),
25882595
Sysno::readv => sys_req!(Readv { fd, iovec:*, iovcnt }),
25892596
Sysno::writev => sys_req!(Writev { fd, iovec:*, iovcnt }),
25902597
Sysno::preadv => sys_req!(Preadv { fd, iovec:*, iovcnt, pos_l, pos_h }),

0 commit comments

Comments
 (0)