Re:What If I Don't Actually Like My Users? (2008)
by JoshTriplett on Friday June 03, 2016 @09:37PM
(#11834474)
You can also use fdopen to get a FILE* from a file descriptor, and then use the buffering and read/write logic of the C library, rather than having to write your own write_in_full function.
The f() calls all buffer for you.
The problem is that write() is entangled in the ioctl() universe in many implementations of 'C' and that gets funky fast.
Beyond* that, reading and writing may involve making your own furniture to hide the ugly from dealing with peripherals.