On 10/8/21 2:23 PM, Warner Losh wrote:
From: Guy Yur<guy...@gmail.com>
Switch checks for !(flags & MAP_ANONYMOUS) with checks for fd != -1.
MAP_STACK and MAP_GUARD both require fd == -1 and don't require mapping
the fd either. Add analysis from Guy Yur detailing the different cases
for MAP_GUARD and MAP_STACK.
Signed-off-by: Guy Yur<guy...@gmail.com>
[ partially merged before, finishing the job and documenting origin]
Signed-off-by: Warner Losh<i...@bsdimp.com>
---
bsd-user/mmap.c | 30 +++++++++++++++++++++++++-----
1 file changed, 25 insertions(+), 5 deletions(-)
Reviewed-by: Richard Henderson <richard.hender...@linaro.org>
r~