Created
July 14, 2017 02:41
-
-
Save sethdusek/6e35513afd047a6ca31525fb3997eb18 to your computer and use it in GitHub Desktop.
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
| extern crate libc; | |
| pub mod zc; |
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
| extern crate libc; | |
| mod zc; | |
| use zc::ZeroCopy; | |
| use std::fs::File; | |
| fn main() { | |
| let mut file = File::open("/tmp/foo").unwrap(); | |
| let mut file_write = File::create("/tmp/foo.txt").unwrap(); | |
| unsafe { file.copy_to_fd(&mut file_write).unwrap(); } | |
| } |
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
| #![feature(test)] | |
| extern crate test; | |
| extern crate zerocopy; | |
| use zerocopy::zc::ZeroCopy; | |
| use test::Bencher; | |
| use std::io::prelude::*; | |
| use std::fs::File; | |
| #[bench] | |
| fn zerocopy(b: &mut Bencher) { | |
| let mut src = File::open("/tmp/foo").unwrap(); | |
| let mut dest = File::create("/tmp/foo.txt").unwrap(); | |
| b.iter(|| { | |
| unsafe { src.copy_to_fd(&mut dest).unwrap() }; | |
| }); | |
| std::fs::remove_file("/tmp/foo.txt"); | |
| } | |
| #[bench] | |
| fn default(b: &mut Bencher) { | |
| let mut src = File::open("/tmp/foo").unwrap(); | |
| let mut dest = File::create("/tmp/foo.txt").unwrap(); | |
| b.iter(|| { | |
| std::io::copy(&mut src, &mut dest).unwrap(); | |
| }); | |
| std::fs::remove_file("/tmp/foo.txt"); | |
| } |
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
| use libc::{c_int, splice}; | |
| use std::os::unix::io::AsRawFd; | |
| use std::io::Result; | |
| use std::io::prelude::*; | |
| const __NR_copy_file_range: ::libc::c_long = 326; | |
| unsafe fn copy_file_range(fd_in: c_int, off_in: *mut ::libc::loff_t, fd_out: c_int, off_out: *mut ::libc::loff_t, len: usize, flags: u32) -> i64 { | |
| ::libc::syscall(__NR_copy_file_range, fd_in, off_in, fd_out, off_out, len, flags) | |
| } | |
| pub trait ZeroCopy<T> { | |
| unsafe fn copy_to_fd(&mut self, fd: &mut T) -> Result<u64>; | |
| } | |
| /*impl <T> ZeroCopy for T where T: AsRawFd + Read { | |
| unsafe fn copy_to_fd<FD: AsRawFd + Write>(&mut self, fd: &mut FD) -> Result<u64> { | |
| let res = splice(0, ::std::ptr::null_mut(), fd.as_raw_fd(), ::std::ptr::null_mut(), 12, 0); | |
| Ok(res as u64) | |
| } | |
| }*/ | |
| impl ZeroCopy<::std::fs::File> for ::std::fs::File { | |
| unsafe fn copy_to_fd(&mut self, fd: &mut ::std::fs::File) -> Result<u64> { | |
| //let len = fd.metadata()?.len() as usize; | |
| let bytes = copy_file_range(self.as_raw_fd(), ::std::ptr::null_mut(), fd.as_raw_fd(), ::std::ptr::null_mut(), 1024, 0); | |
| if bytes < 0 { | |
| Err(::std::io::Error::last_os_error()) | |
| } | |
| else { Ok(bytes as u64) } | |
| } | |
| } | |
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
| c% | |
| kamal@elitebook ~/r/zerocopy master ± cargo run | |
| Compiling zerocopy v0.1.0 (file:///home/kamal/rust/zerocopy) | |
| warning: unused import: `c_int` | |
| --> src/zc.rs:1:12 | |
| | | |
| kamal@elitebook ~/r/zerocopy master ± cat /tmp/foo.txt | |
| kamal@elitebook ~/r/zerocopy master ± rm /tmp/foo.txt | |
| kamal@elitebook ~/r/zerocopy master ± ls | |
| src target Cargo.lock Cargo.toml | |
| kamal@elitebook ~/r/zerocopy master ± cargo run | |
| Compiling zerocopy v0.1.0 (file:///home/kamal/rust/zerocopy) | |
| warning: unused import: `c_int` | |
| --> src/zc.rs:1:12 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/main.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: unused `std::result::Result` which must be used | |
| --> src/main.rs:9:14 | |
| | | |
| 9 | unsafe { file.copy_to_fd(&mut file_write); } | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(unused_must_use)] on by default | |
| Finished dev [unoptimized + debuginfo] target(s) in 0.50 secs | |
| Running `target/debug/zerocopy` | |
| kamal@elitebook ~/r/zerocopy master ± cat /tmp/foo.txt | |
| kamal@elitebook ~/r/zerocopy master ± strace target/debug/zerocopy | |
| execve("target/debug/zerocopy", ["target/debug/zerocopy"], [/* 80 vars */]) = 0 | |
| brk(NULL) = 0x5622fbef0000 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff230e1c000 | |
| access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
| open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 | |
| fstat(3, {st_mode=S_IFREG|0644, st_size=133480, ...}) = 0 | |
| mmap(NULL, 133480, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7ff230dfb000 | |
| close(3) = 0 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\r\0\0\0\0\0\0"..., 832) = 832 | |
| fstat(3, {st_mode=S_IFREG|0644, st_size=14608, ...}) = 0 | |
| mmap(NULL, 2109680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff2309f6000 | |
| mprotect(0x7ff2309f9000, 2093056, PROT_NONE) = 0 | |
| mmap(0x7ff230bf8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7ff230bf8000 | |
| close(3) = 0 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| open("/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340 \0\0\0\0\0\0"..., 832) = 832 | |
| fstat(3, {st_mode=S_IFREG|0644, st_size=31712, ...}) = 0 | |
| mmap(NULL, 2128832, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff2307ee000 | |
| mprotect(0x7ff2307f5000, 2093056, PROT_NONE) = 0 | |
| mmap(0x7ff2309f4000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7ff2309f4000 | |
| close(3) = 0 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240`\0\0\0\0\0\0"..., 832) = 832 | |
| fstat(3, {st_mode=S_IFREG|0755, st_size=142400, ...}) = 0 | |
| mmap(NULL, 2217000, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff2305d0000 | |
| mprotect(0x7ff2305e8000, 2097152, PROT_NONE) = 0 | |
| mmap(0x7ff2307e8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x7ff2307e8000 | |
| mmap(0x7ff2307ea000, 13352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff2307ea000 | |
| close(3) = 0 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| open("/lib/x86_64-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220*\0\0\0\0\0\0"..., 832) = 832 | |
| fstat(3, {st_mode=S_IFREG|0644, st_size=92584, ...}) = 0 | |
| mmap(NULL, 2188336, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff2303b9000 | |
| mprotect(0x7ff2303cf000, 2093056, PROT_NONE) = 0 | |
| mmap(0x7ff2305ce000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7ff2305ce000 | |
| close(3) = 0 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\5\2\0\0\0\0\0"..., 832) = 832 | |
| fstat(3, {st_mode=S_IFREG|0755, st_size=1856752, ...}) = 0 | |
| mmap(NULL, 3959200, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7ff22fff2000 | |
| mprotect(0x7ff2301b0000, 2093056, PROT_NONE) = 0 | |
| mmap(0x7ff2303af000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bd000) = 0x7ff2303af000 | |
| mmap(0x7ff2303b5000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7ff2303b5000 | |
| close(3) = 0 | |
| mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff230df9000 | |
| mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff230df7000 | |
| arch_prctl(ARCH_SET_FS, 0x7ff230dfa680) = 0 | |
| mprotect(0x7ff2303af000, 16384, PROT_READ) = 0 | |
| mprotect(0x7ff2305ce000, 4096, PROT_READ) = 0 | |
| mprotect(0x7ff2307e8000, 4096, PROT_READ) = 0 | |
| mprotect(0x7ff2309f4000, 4096, PROT_READ) = 0 | |
| mprotect(0x7ff230bf8000, 4096, PROT_READ) = 0 | |
| mprotect(0x5622faf91000, 16384, PROT_READ) = 0 | |
| mprotect(0x7ff230e1f000, 4096, PROT_READ) = 0 | |
| munmap(0x7ff230dfb000, 133480) = 0 | |
| set_tid_address(0x7ff230dfa950) = 6072 | |
| set_robust_list(0x7ff230dfa960, 24) = 0 | |
| rt_sigaction(SIGRTMIN, {0x7ff2305d5b40, [], SA_RESTORER|SA_SIGINFO, 0x7ff2305e1670}, NULL, 8) = 0 | |
| rt_sigaction(SIGRT_1, {0x7ff2305d5bd0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7ff2305e1670}, NULL, 8) = 0 | |
| rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 | |
| getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0 | |
| readlink("/etc/malloc.conf", 0x7fff72da5010, 4096) = -1 ENOENT (No such file or directory) | |
| brk(NULL) = 0x5622fbef0000 | |
| mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff22fdf2000 | |
| munmap(0x7ff22fdf2000, 2097152) = 0 | |
| mmap(NULL, 4190208, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff22fbf3000 | |
| munmap(0x7ff22fbf3000, 53248) = 0 | |
| munmap(0x7ff22fe00000, 2039808) = 0 | |
| open("/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "0-3\n", 8192) = 4 | |
| close(3) = 0 | |
| rt_sigaction(SIGPIPE, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x7ff2300277f0}, {SIG_DFL, [], 0}, 8) = 0 | |
| mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff22fa00000 | |
| open("/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3 | |
| getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0 | |
| fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 | |
| read(3, "5622fad3d000-5622fad92000 r-xp 0"..., 1024) = 1024 | |
| read(3, "000 ---p 00016000 08:07 921543 "..., 1024) = 1024 | |
| read(3, ".so\n7ff2309f4000-7ff2309f5000 r-"..., 1024) = 1024 | |
| read(3, " /lib/x86_64-lin"..., 1024) = 424 | |
| close(3) = 0 | |
| sched_getaffinity(6072, 32, [0 1 2 3]) = 8 | |
| rt_sigaction(SIGSEGV, {0x5622fad4e720, [], SA_RESTORER|SA_STACK|SA_SIGINFO, 0x7ff2305e1670}, NULL, 8) = 0 | |
| rt_sigaction(SIGBUS, {0x5622fad4e720, [], SA_RESTORER|SA_STACK|SA_SIGINFO, 0x7ff2305e1670}, NULL, 8) = 0 | |
| sigaltstack(NULL, {ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=0}) = 0 | |
| mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7ff230e1a000 | |
| sigaltstack({ss_sp=0x7ff230e1a000, ss_flags=0, ss_size=8192}, NULL) = 0 | |
| open("/tmp/foo", O_RDONLY|O_CLOEXEC) = 3 | |
| ioctl(3, FIOCLEX) = 0 | |
| open("/tmp/foo.txt", O_WRONLY|O_CREAT|O_TRUNC|O_CLOEXEC, 0666) = 4 | |
| ioctl(4, FIOCLEX) = 0 | |
| splice(3, NULL, 4, NULL, 1024, 0) = -1 EINVAL (Invalid argument) | |
| close(4) = 0 | |
| close(3) = 0 | |
| sigaltstack({ss_sp=NULL, ss_flags=SS_DISABLE, ss_size=8192}, NULL) = 0 | |
| munmap(0x7ff230e1a000, 8192) = 0 | |
| exit_group(0) = ? | |
| +++ exited with 0 +++ | |
| kamal@elitebook ~/r/zerocopy master ± rm /tmp/foo.txt | |
| kamal@elitebook ~/r/zerocopy master ± cat /tmp/foo | |
| hi | |
| kamal@elitebook ~/r/zerocopy master ± strace target/debug/zerocopy | |
| ✘ kamal@elitebook ~/r/zerocopy master ± cargo build | |
| Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs | |
| kamal@elitebook ~/r/zerocopy master ± cat /tmp/foo | |
| hi | |
| kamal@elitebook ~/r/zerocopy master ± strace target/debug/zerocopy | |
| execve("target/debug/zerocopy", ["target/debug/zerocopy"], [/* 80 vars */]) = 0 | |
| brk(NULL) = 0x561e4492f000 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| mmap(NULL, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f15b978e000 | |
| access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) | |
| open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 | |
| fstat(3, {st_mode=S_IFREG|0644, st_size=133480, ...}) = 0 | |
| mmap(NULL, 133480, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f15b976d000 | |
| close(3) = 0 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| open("/lib/x86_64-linux-gnu/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\200\r\0\0\0\0\0\0"..., 832) = 832 | |
| fstat(3, {st_mode=S_IFREG|0644, st_size=14608, ...}) = 0 | |
| mmap(NULL, 2109680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f15b9368000 | |
| mprotect(0x7f15b936b000, 2093056, PROT_NONE) = 0 | |
| mmap(0x7f15b956a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x7f15b956a000 | |
| close(3) = 0 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| open("/lib/x86_64-linux-gnu/librt.so.1", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\340 \0\0\0\0\0\0"..., 832) = 832 | |
| fstat(3, {st_mode=S_IFREG|0644, st_size=31712, ...}) = 0 | |
| mmap(NULL, 2128832, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f15b9160000 | |
| mprotect(0x7f15b9167000, 2093056, PROT_NONE) = 0 | |
| mmap(0x7f15b9366000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x7f15b9366000 | |
| close(3) = 0 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| open("/lib/x86_64-linux-gnu/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240`\0\0\0\0\0\0"..., 832) = 832 | |
| fstat(3, {st_mode=S_IFREG|0755, st_size=142400, ...}) = 0 | |
| mmap(NULL, 2217000, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f15b8f42000 | |
| mprotect(0x7f15b8f5a000, 2097152, PROT_NONE) = 0 | |
| mmap(0x7f15b915a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x18000) = 0x7f15b915a000 | |
| mmap(0x7f15b915c000, 13352, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f15b915c000 | |
| close(3) = 0 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| open("/lib/x86_64-linux-gnu/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\220*\0\0\0\0\0\0"..., 832) = 832 | |
| fstat(3, {st_mode=S_IFREG|0644, st_size=92584, ...}) = 0 | |
| mmap(NULL, 2188336, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f15b8d2b000 | |
| mprotect(0x7f15b8d41000, 2093056, PROT_NONE) = 0 | |
| mmap(0x7f15b8f40000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x15000) = 0x7f15b8f40000 | |
| close(3) = 0 | |
| access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) | |
| open("/lib/x86_64-linux-gnu/libc.so.6", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\20\5\2\0\0\0\0\0"..., 832) = 832 | |
| fstat(3, {st_mode=S_IFREG|0755, st_size=1856752, ...}) = 0 | |
| mmap(NULL, 3959200, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f15b8964000 | |
| mprotect(0x7f15b8b22000, 2093056, PROT_NONE) = 0 | |
| mmap(0x7f15b8d21000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1bd000) = 0x7f15b8d21000 | |
| mmap(0x7f15b8d27000, 14752, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f15b8d27000 | |
| close(3) = 0 | |
| mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f15b976b000 | |
| mmap(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f15b9769000 | |
| arch_prctl(ARCH_SET_FS, 0x7f15b976c680) = 0 | |
| mprotect(0x7f15b8d21000, 16384, PROT_READ) = 0 | |
| mprotect(0x7f15b8f40000, 4096, PROT_READ) = 0 | |
| mprotect(0x7f15b915a000, 4096, PROT_READ) = 0 | |
| mprotect(0x7f15b9366000, 4096, PROT_READ) = 0 | |
| mprotect(0x7f15b956a000, 4096, PROT_READ) = 0 | |
| mprotect(0x561e44187000, 16384, PROT_READ) = 0 | |
| mprotect(0x7f15b9791000, 4096, PROT_READ) = 0 | |
| munmap(0x7f15b976d000, 133480) = 0 | |
| set_tid_address(0x7f15b976c950) = 6352 | |
| set_robust_list(0x7f15b976c960, 24) = 0 | |
| rt_sigaction(SIGRTMIN, {0x7f15b8f47b40, [], SA_RESTORER|SA_SIGINFO, 0x7f15b8f53670}, NULL, 8) = 0 | |
| rt_sigaction(SIGRT_1, {0x7f15b8f47bd0, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x7f15b8f53670}, NULL, 8) = 0 | |
| rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 | |
| getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0 | |
| readlink("/etc/malloc.conf", 0x7ffcdea84ee0, 4096) = -1 ENOENT (No such file or directory) | |
| brk(NULL) = 0x561e4492f000 | |
| mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f15b8764000 | |
| munmap(0x7f15b8764000, 2097152) = 0 | |
| mmap(NULL, 4190208, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f15b8565000 | |
| munmap(0x7f15b8565000, 634880) = 0 | |
| munmap(0x7f15b8800000, 1458176) = 0 | |
| open("/sys/devices/system/cpu/online", O_RDONLY|O_CLOEXEC) = 3 | |
| read(3, "0-3\n", 8192) = 4 | |
| close(3) = 0 | |
| rt_sigaction(SIGPIPE, {SIG_IGN, [PIPE], SA_RESTORER|SA_RESTART, 0x7f15b89997f0}, {SIG_DFL, [], 0}, 8) = 0 | |
| mmap(NULL, 2097152, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f15b8400000 | |
| open("/proc/self/maps", O_RDONLY|O_CLOEXEC) = 3 | |
| getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM64_INFINITY}) = 0 | |
| fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0 | |
| read(3, "561e43f33000-561e43f88000 r-xp 0"..., 1024) = 1024 | |
| read(3, "000 ---p 00016000 08:07 921543 "..., 1024) = 1024 | |
| read(3, ".so\n7f15b9366000-7f15b9367000 r-"..., 1024) = 1024 | |
| read(3, " /lib/x86_64-lin"..., 1024) = 424 | |
| ✘ kamal@elitebook ~/r/zerocopy master ± cargo run | |
| Compiling zerocopy v0.1.0 (file:///home/kamal/rust/zerocopy) | |
| warning: unused import: `c_int` | |
| --> src/zc.rs:1:12 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^ | |
| | | |
| kamal@elitebook ~/r/zerocopy master ± cargo run | |
| Compiling zerocopy v0.1.0 (file:///home/kamal/rust/zerocopy) | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| kamal@elitebook ~/r/zerocopy master ± cargo bench | |
| Compiling zerocopy v0.1.0 (file:///home/kamal/rust/zerocopy) | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/main.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/main.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: unused `std::result::Result` which must be used | |
| --> src/main.rs:9:14 | |
| | | |
| 9 | unsafe { file.copy_to_fd(&mut file_write); } | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(unused_must_use)] on by default | |
| warning: unused `std::result::Result` which must be used | |
| --> src/main.rs:9:14 | |
| | | |
| 9 | unsafe { file.copy_to_fd(&mut file_write); } | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(unused_must_use)] on by default | |
| warning: unused import: `zerocopy::zc::ZeroCopy` | |
| --> benches/test.rs:4:5 | |
| | | |
| 4 | use zerocopy::zc::ZeroCopy; | |
| | ^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| Finished release [optimized] target(s) in 2.2 secs | |
| Running target/release/deps/zerocopy-d1e6ccf182ed8071 | |
| running 0 tests | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out | |
| Running target/release/deps/zerocopy-d5c76dad325ec801 | |
| running 0 tests | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out | |
| Running target/release/deps/test-aa556ac073ca5de5 | |
| running 1 test | |
| test benchmark ... bench: 0 ns/iter (+/- 0) | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 0 filtered out | |
| kamal@elitebook ~/r/zerocopy master ± cargo bench | |
| Finished release [optimized] target(s) in 0.0 secs | |
| Running target/release/deps/zerocopy-d1e6ccf182ed8071 | |
| running 0 tests | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out | |
| Running target/release/deps/zerocopy-d5c76dad325ec801 | |
| running 0 tests | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out | |
| Running target/release/deps/test-aa556ac073ca5de5 | |
| running 1 test | |
| test benchmark ... bench: 0 ns/iter (+/- 0) | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 1 measured; 0 filtered out | |
| kamal@elitebook ~/r/zerocopy master ± cargo build | |
| Compiling zerocopy v0.1.0 (file:///home/kamal/rust/zerocopy) | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| kamal@elitebook ~/r/zerocopy master ± ls | |
| kamal@elitebook ~/r/zerocopy master ± cargo bench | |
| Compiling zerocopy v0.1.0 (file:///home/kamal/rust/zerocopy) | |
| warning: unused import: `std::io::prelude::*;` | |
| --> benches/test.rs:6:5 | |
| | | |
| 6 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: function is never used: `default` | |
| --> benches/test.rs:18:1 | |
| | | |
| kamal@elitebook ~/r/zerocopy master ± cargo bench | |
| Compiling zerocopy v0.1.0 (file:///home/kamal/rust/zerocopy) | |
| warning: unused import: `std::io::prelude::*;` | |
| --> benches/test.rs:6:5 | |
| | | |
| 6 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| Finished release [optimized] target(s) in 0.88 secs | |
| Running target/release/deps/zerocopy-d1e6ccf182ed8071 | |
| running 0 tests | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out | |
| Running target/release/deps/zerocopy-d5c76dad325ec801 | |
| running 0 tests | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out | |
| kamal@elitebook ~/r/zerocopy master ± cargo bench | |
| Compiling zerocopy v0.1.0 (file:///home/kamal/rust/zerocopy) | |
| warning: unused import: `std::io::prelude::*;` | |
| --> benches/test.rs:6:5 | |
| | | |
| 6 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused `std::result::Result` which must be used | |
| --> benches/test.rs:15:5 | |
| | | |
| 15 | std::fs::remove_file("/tmp/foo.txt"); | |
| kamal@elitebook ~/r/zerocopy master ± cargo bench | |
| Compiling zerocopy v0.1.0 (file:///home/kamal/rust/zerocopy) | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> benches/test.rs:6:5 | |
| | | |
| 6 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused `std::result::Result` which must be used | |
| --> benches/test.rs:15:5 | |
| | | |
| 15 | std::fs::remove_file("/tmp/foo.txt"); | |
| kamal@elitebook ~/r/zerocopy master ± cargo bench | |
| Compiling zerocopy v0.1.0 (file:///home/kamal/rust/zerocopy) | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> benches/test.rs:6:5 | |
| | | |
| 6 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused `std::result::Result` which must be used | |
| --> benches/test.rs:15:5 | |
| | | |
| 15 | std::fs::remove_file("/tmp/foo.txt"); | |
| kamal@elitebook ~/r/zerocopy master ± cargo bench | |
| Compiling zerocopy v0.1.0 (file:///home/kamal/rust/zerocopy) | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `splice` | |
| --> src/zc.rs:1:19 | |
| | | |
| 1 | use libc::{c_int, splice}; | |
| | ^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> src/zc.rs:4:5 | |
| | | |
| 4 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| warning: constant `__NR_copy_file_range` should have an upper case name such as `__NR_COPY_FILE_RANGE` | |
| --> src/zc.rs:5:1 | |
| | | |
| 5 | const __NR_copy_file_range: ::libc::c_long = 326; | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(non_upper_case_globals)] on by default | |
| warning: unused import: `std::io::prelude::*;` | |
| --> benches/test.rs:6:5 | |
| | | |
| 6 | use std::io::prelude::*; | |
| | ^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(unused_imports)] on by default | |
| warning: unused `std::result::Result` which must be used | |
| --> benches/test.rs:15:5 | |
| | | |
| 15 | std::fs::remove_file("/tmp/foo.txt"); | |
| | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
| | | |
| = note: #[warn(unused_must_use)] on by default | |
| kamal@elitebook ~/r/zerocopy master ± cargo bench | |
| Finished release [optimized] target(s) in 0.0 secs | |
| Running target/release/deps/zerocopy-d1e6ccf182ed8071 | |
| running 0 tests | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out | |
| Running target/release/deps/zerocopy-d5c76dad325ec801 | |
| running 0 tests | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out | |
| Running target/release/deps/test-aa556ac073ca5de5 | |
| running 2 tests | |
| test default ... ^C | |
| ✘ kamal@elitebook ~/r/zerocopy master ± cargo bench | |
| Finished release [optimized] target(s) in 0.0 secs | |
| Running target/release/deps/zerocopy-d1e6ccf182ed8071 | |
| running 0 tests | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out | |
| Running target/release/deps/zerocopy-d5c76dad325ec801 | |
| running 0 tests | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out | |
| Running target/release/deps/test-aa556ac073ca5de5 | |
| running 2 tests | |
| test default ... bench: 238 ns/iter (+/- 13) | |
| test zerocopy ... bench: 2,290 ns/iter (+/- 1,896) | |
| test result: ok. 0 passed; 0 failed; 0 ignored; 2 measured; 0 filtered out | |
| kamal@elitebook ~/r/zerocopy master ± |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment