Eric Andersen | 51b8bd6 | 2002-07-03 11:46:38 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * Mini xgethostbyname2 implementation. |
| 4 | * |
"Robert P. J. Day" | 5d8843e | 2006-07-10 11:41:19 +0000 | [diff] [blame] | 5 | * Licensed under GPLv2 or later, see file LICENSE in this tarball for details. |
Eric Andersen | 51b8bd6 | 2002-07-03 11:46:38 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <netdb.h> |
| 9 | #include "libbb.h" |
| 10 | |
| 11 | |
Glenn L McGrath | d7fb1b3 | 2002-11-26 02:40:56 +0000 | [diff] [blame] | 12 | #ifdef CONFIG_FEATURE_IPV6 |
Eric Andersen | 51b8bd6 | 2002-07-03 11:46:38 +0000 | [diff] [blame] | 13 | struct hostent *xgethostbyname2(const char *name, int af) |
| 14 | { |
| 15 | struct hostent *retval; |
| 16 | |
| 17 | if ((retval = gethostbyname2(name, af)) == NULL) |
Manuel Novoa III | cad5364 | 2003-03-19 09:13:01 +0000 | [diff] [blame] | 18 | bb_herror_msg_and_die("%s", name); |
Eric Andersen | 51b8bd6 | 2002-07-03 11:46:38 +0000 | [diff] [blame] | 19 | |
| 20 | return retval; |
| 21 | } |
| 22 | #endif |