16 Commits (master)

Author SHA1 Message Date
Avril bc2357c6b6
Attempted to add new feature flag: `memfile-size-output`: Which will pre- or post- set the size of `stdout` to the correct buffer size, allowing consumers of `collect`"s stdout pipe to know the size just like a file. However, `ftruncate()` always fails on stdout. Before re-enabling the feature, we must find out how to set the size of a pipe, if/when you even can, and what syscall(s) you need to do it with.
2 years ago
Avril 35c6cabce3
memfile::hp: Changed `get_masks()` to return an iterator of `SizedMask` instead of just `Mask` to retain the size of the huge-page itself in bytes (for `ftruncate()` calls, and `mmap()` calls.)
2 years ago
Avril 872ea74421
It seems creating HUGETLB memory files either just doesn"t work or changes their behaviour so that any (or at least, small arbitrary) writing or fallocate()ing to them fails... Read up on MFD_HUGETLB more then re-do a test like `memfd_create_wrapper()` to find out why... and if it depends on the MAP_HUGE_ mask, and if so, find one that works... (We know when masks are invalid, since the error message is different. The masks collected via `get_masks()` *are* valid for this system, they just prevent the fd from being any way useful.)
2 years ago
Avril bdfd0a6268
memfile::hp: Added `PartialEq` impl for `c_int` (checks `MAP_HUGE` from `.raw()`), and `c_uint` (checks `memfd_create()` useable constant from `.mask()`.)
2 years ago
Avril 573845a667
memfile::hp: Added `get_masks()`: Returns an iterator over all `MAP_HUGE` masks found on system.
2 years ago
Avril 9b4bb475c0
Added extension methods for flattening `eyre::Result<eyre:Result<T>>`s and related constructs.
2 years ago
Avril e7b96af012
memfile::hp: Added test for `Mask`"s `.raw()` (`MAP_HHUGE_` flag generation.)
2 years ago
Avril c4f73ccfa0
memfile::hp: `find_size_bytes()` fixed and tested; should change function to return `eyre::Result<usize>` instead of `Option<usize>` considering how many different failure-paths exist.
2 years ago
Avril 9c18a5b940
memfile::hp: Added `Mask`: Converts bytes into a suitable `MAP_HUGE_` constant via its `.raw()` method, and a suitable flag for `memfd_create()` via its `.mask()` method.
2 years ago
Avril b882f0ae97
Completed `hp::find_size_bytes()`, and added const-generated lookup table for non "k" seperators.
2 years ago
Avril d46efebbf7
Added huge-page mask calculation algorithm to comment of module file `memfile::hp`.
2 years ago
Avril 59363848a2
Started: `memfile::hp`: `MFD_HUGETLB` can be used when a size is known to exceed into the boundary of a hugepage. Currently in the process of writing function to collect all possible hugepage sizes and generate the correct flag masks for `memfd_create(, MFD_HUGETLB | ...)` for each one; and the smallest one that contains the known size can be used for the `memfd_create()` call (if the size fits any at all.)
2 years ago
Avril 9ecd0ea3d8
Fixed silly bug preventing building on rust-stable.
2 years ago
Avril edb57c7c95
memfile: Disambiguated memfile errors resulting in `fallocate()` sizes being too large or the call itself failing.
2 years ago
Avril ed957bcec8
feature memfile: added `RawFile::open_mem()`
2 years ago
Avril 65c297b228
Started adding `memfile` feature: Use a `memfd_create()`d in-memory temporary file.
2 years ago