Motivation for this addition is that often shells will run processes in a pipeline in parallel, regardless of if they have any input yet. This leads to a lot of messy `ifne` useage that is unneeded with this option. It also allows for greater efficiency in memfd mode as the process passed the /proc fd can be spawned before the copy to stdout (TODO: behaviour of this still undefined.) and the `memfd_create()` fd can be used instead of tweaking stdout to be used.
This essentially functions the same way as shell process substitution but with an actually complete file; it waits for all input to be collected *before* spawning the process. This can be useful for interactive programs like gpg, which often are not fond of waiting for input and want it all immediately. Programs that map files into memory can also not like being passed pipe fds, in memfd mode, this shouldn"t be a problem, the fd should be shareable immediately with the correct `ioctl()` call (or perhaps even without.)
Fortune for collect's current commit: Small blessing − 小吉
memfile::hp: Switched from `fallocate()` to `ftruncate()`: This system-call actually does allow the size to be set, as long as it is a multiple of the huge-page size used to create it.
memfile:: Added `RawFile::truncate_size()`: Set size using `ftruncate()` instead of `fallocate()`: This difference matters a lot with hugetlbfs-backed FDs.
Fortune for collect's current commit: Blessing − 吉
The branch is merged anyway, just in case any of the extra code used in it can be extracted later.
Fortune for collect's current commit: Future small blessing − 末小吉
This branch will be merged but the `hugetlb` feature flag will be removed.
This matter is now closed.
Fortune for collect's current commit: Future blessing − 末吉
Added (default) feature-flag for `hugetlb`: Will use `memfile::hp` for `memfile` enabled feature.
Added tests for both checked and unchecked `Mask` creation.
Added feature `hugepage-checked-masks`: Use checked `Mask` creation in `get_masks{,_in}()`. Only useful for debugging or for ensuring no invalid values slip past mask creation. Disabled by default and offers not much of an improvement other than a bit more safety (integer arithmatic checking).
Fortune for collect's current commit: Half curse − 半凶
The above is all either `const fn` or checked, and can be bitwise OR"d together, producing a higher `Mask`, or bitwise OR"d with an arbitrary `c_uint` to produce a valid mask for `memfd_create()` (in the latter case, the OR with MFD_HUGETLB is unneeded, as `Mask` applies this itself.)
Fortune for collect's current commit: Blessing − 吉
TODO: This will be a seperate comptime feature: `hugetlb`: Extend `memfile` with the ability to allocate apporpirately sized huge-pages when input size is known to extend into them.
Fortune for collect's current commit: Blessing − 吉
Needs testing, and the XXX comment about `memfd_create()` name lifetimes also needs testing. (If they do need to be static; `stackalloc` as a dependancy can be removed entirely, then: `DEFAULT_NAME` will be changed to a CString, function parameter `name` and `error::MemfileCreationStep::Create(name)` will be changed to `Option<&"static CStr>`.
Fortune for collect's current commit: Future blessing − 末吉