Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

fallocate

Public Function
std.os.linux.fallocate
pub fn fallocate(fd: fd_t, mode: mode_t, offset: off_t, length: off_t) usize

Params

File

os/linux.zig:844
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
pub fn fallocate(fd: fd_t, mode: mode_t, offset: off_t, length: off_t) usize {
    if (@sizeOf(syscall_arg_t) < @sizeOf(u64)) {
        const offset_halves = splitValue64(offset);
        const length_halves = splitValue64(length);
        return syscall6(
            .fallocate,
            @as(u32, @bitCast(fd)),
            mode,
            offset_halves[0],
            offset_halves[1],
            length_halves[0],
            length_halves[1],
        );
    } else {
        return syscall4(
            .fallocate,
            @as(u32, @bitCast(fd)),
            mode,
            @as(u64, @bitCast(offset)),
            @as(u64, @bitCast(length)),
        );
    }
}