1 #define _GNU_SOURCE 2 #include <netdb.h> 3 #include <stdio.h> 4 herror(const char * msg)5 void herror(const char* msg) { 6 fprintf(stderr, "%s%s%s", msg ? msg : "", msg ? ": " : "", hstrerror(h_errno)); 7 } 8