Closed
Description
This function is part of the C standard. I don't know the full set of targets that support it.
- Linux: glibc has it, and I found it in musl, too (but that uses
malloc
+ offset -- no idea how they're making sure that you canfree
the resulting pointer) - FreeBSD also seems to have it
- macOS: available since 10.15 according to this (but buggy until today... but that's not libc's concern)
- Solaris seems to have it, and same for Illumos (again, buggy...)
- The function is mentioned here so I assume (recent enough) Android also has it.