Implementation of cp program that prints the number of bytes copied
Do not call printf from the signal handler. It is not signal safe. man sigaction for details.
write_buf is somewhat convoluted. while (rlen &gt; 0) seems more straightforward.

Also, it is forced to write the entire buffer. It means that your program only pays attention to the Ctrl-C in between of writes. You may get more crispy resolution by testing wlen &lt; rlen and inspecting errno; if write was interrupted, it would be EINTR.

void function with an in-out parameter (bytes in your case) is strange to say the least. The void function is not supposed to return anything, and in-out parameters are generally unclean. Just return bytes.
error() is a GNU extension and should not be used in programs intended to be portable. In any case, the pass errno as a second parameter. The user is very interested what exactly was wrong.
If the program was not interrupted, it doesn't print number of bytes copied. Looks like a bug (or a very dubious design decision) to me.