aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-08-22 11:04:47 +0200
committerFlorian Weimer <fweimer@redhat.com>2022-08-22 11:11:02 +0200
commit8b139cd4f1074ae0d95d9bff60db283a1ed72734 (patch)
tree30d35948db94076226c4c3ec79acade335013823 /sysdeps/unix
parente982657073c4db21459ffd9e17bc505b1d64b876 (diff)
downloadglibc-8b139cd4f1074ae0d95d9bff60db283a1ed72734.zip
glibc-8b139cd4f1074ae0d95d9bff60db283a1ed72734.tar.gz
glibc-8b139cd4f1074ae0d95d9bff60db283a1ed72734.tar.bz2
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"). (cherry picked from commit e7ad26ee3cb74e61d0637c888f24dd478d77af58)
Diffstat (limited to 'sysdeps/unix')
-rw-r--r--sysdeps/unix/sysv/linux/alpha/brk_call.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/sysdeps/unix/sysv/linux/alpha/brk_call.h b/sysdeps/unix/sysv/linux/alpha/brk_call.h
index b8088cf..0b851b6 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;
}