33 ms·
It depends on what you want to do. If that's sending data into the kernel right now – like procfs or a socket – then write() is what you need. fprintf() will pr
by ilammy 6y ago
It depends on what you want to do. If that's sending data into the kernel right now – like procfs or a socket – then write() is what you need. fprintf() will provide more throughput by buffering the data and sending a batched write() later, but sometimes you need to send stuff right now and be sure that it's in the kernel when you get control back.