The awesome ltrace tool traces both library calls and system calls, and is therefore perfect to examine what is going on in this case.
A closer analysis shows that open returns the file descriptor 3 (next free one after stdin, out and err).
read then uses that file descriptor, but TODO why mmap's arguments are limited to four, and we can't see which fd was used there since that is the 5th argumentTODO why mmap's arguments are limited to four, and we can't see which fd was used there since that is the 5th argument. strace confirms as expected that 3 is the one, and the order of the universe is restored.
The awesome ltrace tool traces both library calls and system calls, and is therefore perfect to examine what is going on in this case.