| ... | @@ -1876,6 +1876,21 @@ pub fn ptrace( | ... | @@ -1876,6 +1876,21 @@ pub fn ptrace( |
| 1876 | ); | 1876 | ); |
| 1877 | } | 1877 | } |
| 1878 | | 1878 | |
| | 1879 | pub fn cachestat( |
| | 1880 | fd: fd_t, |
| | 1881 | cstat_range: *const cache_stat_range, |
| | 1882 | cstat: *cache_stat, |
| | 1883 | flags: u32, |
| | 1884 | ) usize { |
| | 1885 | return syscall4( |
| | 1886 | .cachestat, |
| | 1887 | @as(usize, @bitCast(@as(isize, fd))), |
| | 1888 | @intFromPtr(cstat_range), |
| | 1889 | @intFromPtr(cstat), |
| | 1890 | flags, |
| | 1891 | ); |
| | 1892 | } |
| | 1893 | |
| 1879 | pub const E = switch (native_arch) { | 1894 | pub const E = switch (native_arch) { |
| 1880 | .mips, .mipsel => @import("linux/errno/mips.zig").E, | 1895 | .mips, .mipsel => @import("linux/errno/mips.zig").E, |
| 1881 | .sparc, .sparcel, .sparc64 => @import("linux/errno/sparc.zig").E, | 1896 | .sparc, .sparcel, .sparc64 => @import("linux/errno/sparc.zig").E, |
| ... | @@ -5829,3 +5844,16 @@ pub const PTRACE = struct { | ... | @@ -5829,3 +5844,16 @@ pub const PTRACE = struct { |
| 5829 | pub const SECCOMP_GET_METADATA = 0x420d; | 5844 | pub const SECCOMP_GET_METADATA = 0x420d; |
| 5830 | pub const GET_SYSCALL_INFO = 0x420e; | 5845 | pub const GET_SYSCALL_INFO = 0x420e; |
| 5831 | }; | 5846 | }; |
| | 5847 | |
| | 5848 | pub const cache_stat_range = extern struct { |
| | 5849 | off: u64, |
| | 5850 | len: u64, |
| | 5851 | }; |
| | 5852 | |
| | 5853 | pub const cache_stat = extern struct { |
| | 5854 | cache: u64, |
| | 5855 | dirty: u64, |
| | 5856 | writeback: u64, |
| | 5857 | evicted: u64, |
| | 5858 | recently_evicted: u64, |
| | 5859 | }; |