Available on crate feature
async only.Expand description
O_DIRECT alignment discovery.
O_DIRECT requires the file offset, the transfer length, and the buffer
address to be aligned.
Sources, in order of accuracy:
statx(STATX_DIOALIGN)(Linux 6.1+) - authoritative, per-file, and distinguishes memory alignment from offset/length alignment. It can also say definitively that a file does not support direct I/O./sys/dev/block/<major>:<minor>/queue/logical_block_size- the device sector size. Right for most filesystems, but misses cases where the filesystem imposes something stricter.
When neither can answer, the alignment stays unknown and the caller reads through the page cache.