Hi, On OpenBSD, aligned_alloc currently fails with EINVAL if the requested size is not a multiple of the requested alignment. Indeed, this stems from a botch in the original specification in the C11 standard.
See Defect Report 460 or the NetBSD man page for more details, but this silly requirement has been dropped in C17/C18, and I believe OpenBSD should conform to this. I haven't tested, but it might be sufficient to simply remove the check.