pub const CreateOptions = struct len: usizeSize of the mapping, in bytes. If this is longer than the file size, memory beyond the file end will be filled with zeroes and it is unspecified whether, after calling write, the file length will be set to len or remain unchanged.
This value has no minimum alignment requirement, but may gain efficiency benefits from being a multiple of File.Stat.block_size.
protection: std.process.MemoryProtection = .{ .read = true, .write = true }When this has read set to false, bytes that are not modified before a sync may have the original file contents, or may be set to zero.
undefined_contents: bool = falseIf set to true, allows bytes observed before calling read to be undefined, and bytes unwritten before calling write to write undefined memory to the file.
populate: bool = truePrefault the pages. If this option is unsupported, it is silently ignored. Aside from custom Io implementations, this option is only supported on Linux.
offset: u64 = 0Asserted to be a multiple of page size which can be obtained via std.heap.pageSize.
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62pub const CreateOptions = struct {
/// Size of the mapping, in bytes. If this is longer than the file size,
/// `memory` beyond the file end will be filled with zeroes and it is
/// unspecified whether, after calling `write`, the file length will be
/// set to `len` or remain unchanged.
///
/// This value has no minimum alignment requirement, but may gain
/// efficiency benefits from being a multiple of `File.Stat.block_size`.
len: usize,
/// When this has read set to false, bytes that are not modified before a
/// sync may have the original file contents, or may be set to zero.
protection: std.process.MemoryProtection = .{ .read = true, .write = true },
/// If set to `true`, allows bytes observed before calling `read` to be
/// undefined, and bytes unwritten before calling `write` to write
/// undefined memory to the file.
undefined_contents: bool = false,
/// Prefault the pages. If this option is unsupported, it is silently
/// ignored. Aside from custom Io implementations, this option is only
/// supported on Linux.
populate: bool = true,
/// Asserted to be a multiple of page size which can be obtained via
/// `std.heap.pageSize`.
offset: u64 = 0,
}