Skip to content
  • Ben Gamari's avatar
    base: Always clamp reads/writes to 2GB in length · 97497bae
    Ben Gamari authored
    Previously we did this only on Darwin due to #17414. However, even on
    other platforms >2GB writes are on shaky ground. POSIX explicitly says
    that the result is implementation-specified and Linux will write at most
    0x7ffff000, even on 64-bit platforms. Moreover, getting the sign
    of the syscall result correct is tricky, as demonstrated by the fact
    that T17414 currently fails on FreeBSD.
    
    For simplicity we now just uniformly clamp to 0x7ffff000 on all
    platforms.
    97497bae