From: Florian Weimer Date: Mon, 22 Aug 2022 09:04:47 +0000 (+0200) Subject: alpha: Fix generic brk system call emulation in __brk_call (bug 29490) X-Git-Tag: glibc-2.37~413 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e7ad26ee3cb74e61d0637c888f24dd478d77af58;p=thirdparty%2Fglibc.git alpha: Fix generic brk system call emulation in __brk_call (bug 29490) 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"). --- diff --git a/sysdeps/unix/sysv/linux/alpha/brk_call.h b/sysdeps/unix/sysv/linux/alpha/brk_call.h index b8088cf13f9..0b851b6c866 100644 --- a/sysdeps/unix/sysv/linux/alpha/brk_call.h +++ b/sysdeps/unix/sysv/linux/alpha/brk_call.h @@ -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; }