]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
alpha: Fix generic brk system call emulation in __brk_call (bug 29490)
authorFlorian Weimer <fweimer@redhat.com>
Mon, 22 Aug 2022 09:04:47 +0000 (11:04 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 22 Aug 2022 09:11:58 +0000 (11:11 +0200)
The kernel special-cases the zero argument for alpha brk, and we can
use that to restore the generic Linux error handling behavior.

Fixes commit b57ab258c1140bc45464b4b9908713e3e0ee35aa ("Linux:
Introduce __brk_call for invoking the brk system call").

(cherry picked from commit e7ad26ee3cb74e61d0637c888f24dd478d77af58)

NEWS
sysdeps/unix/sysv/linux/alpha/brk_call.h

diff --git a/NEWS b/NEWS
index fdb7a11b152dae9d4820acf1faf9d6b9f7276418..3148b7682cbdc6df78150d34a8263e88c5524c88 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -46,6 +46,7 @@ The following bugs are resolved with this release:
   [29225] network: Mistyped define statement in socket/sys/socket.h in
     line 184
   [29446] _dlopen now ignores dl_caller argument in static mode
+  [29490] alpha: New __brk_call implementation is broken
 
 \f
 Version 2.35
index b8088cf13f938c88b263f83efa1941e3c59a1a8a..0b851b6c8664e8d5dfcde26de9b8ef3b72bcfd1a 100644 (file)
@@ -21,8 +21,7 @@ __brk_call (void *addr)
 {
   unsigned long int result = INTERNAL_SYSCALL_CALL (brk, addr);
   if (result == -ENOMEM)
-    /* Mimic the default error reporting behavior.  */
-    return addr;
-  else
-    return (void *) result;
+    /* Mimic the generic error reporting behavior.  */
+    result = INTERNAL_SYSCALL_CALL (brk, 0);
+  return (void *) result;
 }