v2 / vlib / veb / sendfile_linux.c.v
10 lines · 7 sloc · 288 bytes · a87a4d73b9ab25cfff0822f4e94cf2a2d9e64323
Raw
1module veb
2
3#include <sys/sendfile.h>
4
5fn C.sendfile(out_fd i32, in_fd i32, offset voidptr, count i32) i32
6
7fn sendfile(out_fd int, in_fd int, nr_bytes int) int {
8 // always pass nil as offset, so the file offset will be used and updated.
9 return C.sendfile(out_fd, in_fd, 0, nr_bytes)
10}
11