• Christopher Yeoh's avatar
    [PATCH] mmap can return incorrect errno · 1e54dd8a
    Christopher Yeoh authored
    mmap currently sets errno to EINVAL when it should be ENOMEM.
    SUS/POSIX states that ENOMEM should be returned when:
    
    "MAP_FIXED was specified, and the range [addr, addr + len) exceeds
    that allowed for the address space of a process; or if MAP_FIXED was
    not specified and there is insufficient room in the address space to
    effect the mapping."
    
    The following patch (against 2.4.17) fixes this behaviour:
    1e54dd8a
mmap.c 30.4 KB