posix_memalign(3) Library Functions Manual posix_memalign(3) posix_memalign - (libc -lc) #include int posix_memalign(void **memptr, size_t alignment, size_t size); glibc ( feature_test_macros(7)): posix_memalign(): _POSIX_C_SOURCE >= 200112L posix_memalign() size *memptr. alignment 2 sizeof(void *). free(3). size 0 *memptr NULL . . aligned_alloc(3) . . posix_memalign() . errno. EINVAL alignment 2 sizeof(void *). ENOMEM . attributes(7). +------------+------------------------------------+--------------------+ || | | +------------+------------------------------------+--------------------+ |posix_memalign()| | MT-Safe | | | | | +------------+------------------------------------+--------------------+ POSIX.1-2024. glibc 2.1.91. POSIX.1d, POSIX.1-2001. ( ) posix_memalign() memptr . POSIX.1-2008 TC2. aligned_alloc(3) 3 . . : . 6.18 8 2026 posix_memalign(3)