bsd-user: Implement do_obreak function

Match linux-user, by manually applying the following commits, in order:

d28b3c90cf   linux-user: Make sure initial brk(0) is page-aligned
15ad98536a   linux-user: Fix qemu brk() to not zero bytes on current page
dfe49864af   linux-user: Prohibit brk() to to shrink below initial heap address
eac78a4b0b   linux-user: Fix signed math overflow in brk() syscall
c6cc059eca   linux-user: Do not call get_errno() in do_brk()
e69e032d1a   linux-user: Use MAP_FIXED_NOREPLACE for do_brk()
cb9d5d1fda   linux-user: Do nothing if too small brk is specified
2aea137a42   linux-user: Do not align brk with host page size

Signed-off-by: Stacey Son <sson@FreeBSD.org>
Signed-off-by: Karim Taha <kariem.taha2.7@gmail.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20230925182709.4834-19-kariem.taha2.7@gmail.com>
This commit is contained in:
Stacey Son
2023-09-25 21:27:04 +03:00
committed by Warner Losh
parent 83b045ad4e
commit a99d740347
2 changed files with 52 additions and 0 deletions

View File

@@ -855,6 +855,13 @@ static abi_long freebsd_syscall(void *cpu_env, int num, abi_long arg1,
break;
#endif
/*
* Misc
*/
case TARGET_FREEBSD_NR_break:
ret = do_obreak(arg1);
break;
/*
* sys{ctl, arch, call}
*/