Reimplemented print_num as tr_print_num with C.
Added a test for getsockname(2).