In a Linux userland program, if I open(2) /dev/null (or do something equivalent, like redirecting stdout to /dev/null), and then write(2) to the resulting handle, how deep into the kernel does my request to write get propagated before being discarded? Does a memory copy of the data happen? Does a kernel context switch happen?
If I use writev(2) against the /dev/null handle instead, is the kernel smart enough to skip walking the passed iovec?