Sample Header Ad - 728x90

Why Linux read() avoids using full 2 GiB in one call

15 votes
3 answers
2798 views
Reading the manual page (man 2 read) on my Debian system, I see the following note: >NOTES >[...] >On Linux, read() (and similar system calls) will transfer at most > 0x7ffff000 (2,147,479,552) bytes, returning the number of bytes actually > transferred. (This is true on both 32-bit and 64-bit systems.) I am guessing something is being done with the remaining 0xfff (4095) bytes so that this number is chosen for a specific implementation detail. So my question is: Why is it 0x7ffff000 and not simply (naively) 0x7fffffff?
Asked by malat (3429 rep)
Apr 29, 2025, 08:11 AM
Last activity: May 6, 2025, 05:20 AM