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.)
letmask=super::get_masks()?.next().ok_or(eyre!("No masks found"))?.wrap_err("Failed to extract mask")?;
eprintln!("Using mask: {mask:x} ({mask:b})");
letcreate=mask.memfd_create_wrapper_flags();
letbuf={
letmutbuf=vec![0;name.as_bytes_with_nul().len()];
println!("Allocated {} bytes for buffer",buf.len());
letmutfile: fs::File={
letmutfile=unsafe{super::RawFile::from_raw_fd(libc::memfd_create(name.as_ptr(),super::MEMFD_CREATE_FLAGS|mask.mask()))};//.wrap_err(eyre!("Failed to create file"))?;