On Solaris 11.4, Solaris OpenIndiana, Solaris OmniOS, I see this test failure: ../../gltests/test-memalign.c:51: assertion 'aligned2_blocks[i] != NULL' failed FAIL test-memalign (exit status: 262) Apparently memalign() does not support alignments 1 and 2 on this platform. This patch fixes it, by using malloc() in these cases. (Bumping the alignment to 4 in these cases would be an alternative workaround.) 2020-12-31 Bruno Haible memalign: Work around Solaris bug. * lib/memalign.c: New file. * m4/memalign.m4: New file. * modules/memalign (Files): Add them. (Depends-on): Add malloc-h. (configure.ac): Invoke gl_FUNC_MEMALIGN. Conditionally compile memalign.c. Set module indicator. (Include): Include unconditionally. * doc/glibc-functions/memalign.texi: Mention the Solaris issues. malloc-h: Add tests. * tests/test-malloc-h.c: New file. * modules/malloc-h-tests: New file. * tests/test-malloc-h-c++.cc: New file. * modules/malloc-h-c++-tests: New file. malloc-h: New module. * lib/malloc.in.h: New file. * m4/malloc_h.m4: New file. * modules/malloc-h: New file. * doc/glibc-headers/malloc.texi: New file. * doc/gnulib.texi (Glibc Header File Substitutes): Include it.