An author at the Hostile Fork blog decided to answer a question on how the printf function actually gets implemented in C. This came from StackOverflow. It was assumed that it ended up with some inline assembly code. Let's see what he found out.
The truth of the matter is that it depends on the implementation of your compiler. Hostile Fork guy checked out the GNU C compiler. Turns out printf calls vfprintf with stdout as a parameter. vfprintf calls some macros. They do a putc to a buffered output.
In the end, the calls map down to the write function. And lo and beyond, this becomes a syscall. Next homework step is to trace how Microsoft Visual Studio handles printf.
Be Brave to Get Work Done - I was woken up this morning from a call from work. Not a good sign. Apparently the customer found a potential problem in our delivery. I got on a conferen...