On Thu, Dec 19, 2019 at 03:37:14AM -0500, Alex Brachet-Mialot wrote:
> In src/mman/mmap.c mmap (after light einval checks) just returns the result
> of the syscall directly. But presumably the OS returns -E* and not -1 for
> all failures. Otherwise something like EBADF could never go reported.
> Presumably musl is compliant here and returns -1 on error and not the
> negative value from the OS but I’m not seeing that logic. Am I missing
> something here? Thanks.
It returns (void *)__syscall_ret(ret)
Have a look in src/internal/syscall_ret.c