free: preserve errno [BZ#17924]
In the next release of POSIX, free must preserve errno <https://www.austingroupbugs.net/view.php?id=385 >. Modify __libc_free to save and restore errno, so that any internal munmap etc. syscalls do not disturb the caller's errno. Add a test malloc/tst-free-errno.c (almost all by Bruno Haible), and document that free preserves errno. Reviewed-by:Adhemerval Zanella <adhemerval.zanella@linaro.org>
Loading