Skip to main content

Module linux

Module linux 

Source
Available on Linux and Unix and crate feature pool only.
Expand description

The Linux syscalls behind the file store.

Constantsยง

OPEN_NAMED_ATTEMPTS ๐Ÿ”’
Names the unlinked fallback file tries before EEXIST fails the open.

Functionsยง

available_bytes ๐Ÿ”’
Bytes available to unprivileged writers on the volume holding path.
c_path ๐Ÿ”’
Converts path to the NUL-terminated form libc expects. Fails with InvalidInput if path contains an interior NUL.
drop_cache ๐Ÿ”’
Drops the clean pages of [offset, offset + len) from the page cache.
fallocate ๐Ÿ”’
Allocates blocks for [offset, offset + len).
fallocate_mode ๐Ÿ”’
is_memory_backed ๐Ÿ”’
Whether path is on tmpfs or ramfs.
off_t ๐Ÿ”’
Converts a file offset to off_t. Fails with EFBIG if it does not fit, the error the kernel reports for an offset past the file size limit.
open_anonymous ๐Ÿ”’
Opens a nameless read-write file in dir, close-on-exec, with O_DIRECT if direct.
pread ๐Ÿ”’
One pread into buf at offset.
punch_hole ๐Ÿ”’
Deallocates the blocks of [offset, offset + len), keeping the file size.
pwrite ๐Ÿ”’
One pwrite of buf at offset.
tmpfile_fault ๐Ÿ”’
The injected failure of the next O_TMPFILE open, if any.
writeback_and_drop ๐Ÿ”’
Writes back [offset, offset + len) synchronously and drops it from the page cache.