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 b57ab258c1 ("Linux:
Introduce __brk_call for invoking the brk system call").

(cherry picked from commit e7ad26ee3c)
This commit is contained in:
Florian Weimer 2022-08-22 11:04:47 +02:00
parent 4bc889c01c
commit 1fcc7bfee2
2 changed files with 4 additions and 4 deletions

1
NEWS
View File

@ -113,6 +113,7 @@ The following bugs are resolved with this release:
[29213] libc: gconv_parseconfdir is not y2038 aware
[29214] nptl: pthread_setcanceltype fails to set type
[29446] _dlopen now ignores dl_caller argument in static mode
[29490] alpha: New __brk_call implementation is broken
Version 2.34

View 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;
}