about summary refs log tree commit diff
path: root/malloc/Makefile
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2020-12-29 00:45:49 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2020-12-29 00:46:46 -0800
commit69fda43b8dd795c3658869633ca0708ed3134006 (patch)
treee86b216293d450bfbecaaf8230c3247444b668c4 /malloc/Makefile
parent016c64236dee6e28f09c10ba38f274aad7205f95 (diff)
downloadglibc-69fda43b8dd795c3658869633ca0708ed3134006.tar.gz
glibc-69fda43b8dd795c3658869633ca0708ed3134006.tar.xz
glibc-69fda43b8dd795c3658869633ca0708ed3134006.zip
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>
Diffstat (limited to 'malloc/Makefile')
-rw-r--r--malloc/Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/malloc/Makefile b/malloc/Makefile
index 37173b29ea..39ffaa7161 100644
--- a/malloc/Makefile
+++ b/malloc/Makefile
@@ -34,6 +34,7 @@ tests := mallocbug tst-malloc tst-valloc tst-calloc tst-obstack \
 	 tst-interpose-nothread \
 	 tst-interpose-thread \
 	 tst-alloc_buffer \
+	 tst-free-errno \
 	 tst-malloc-tcache-leak \
 	 tst-malloc_info tst-mallinfo2 \
 	 tst-malloc-too-large \