3 ms·
Largely, yes. Which is why strace is so useful as a debugging tool. It's also why you want to do buffered IO (read/write in kB at a time) to minimise call overh
by shabble 12y ago
Largely, yes. Which is why strace is so useful as a debugging tool. It's also why you want to do buffered IO (read/write in kB at a time) to minimise call overhead.
There is mmap[1] (controlled, unsurprisingly, by syscalls), which will give you a memory region that may be updated transparently for you by the kernel, but in general, it's all syscalls.
The other nice thing about the syscall interface is that it gives the kernel an opportunity to suspend the calling process and schedule something else if it can't fulfill their request right now (hence, blocking IO), so you're not actually polling. Of course, a preeemptive scheduler (like everything actually is) can step in and suspend you anyway, but the syscall is a nice place to do it cooperatively.
[1] https://en.wikipedia.org/wiki/Mmap https://en.wikipedia.org/wiki/Mmap