Matt Kraai | c55b8d4 | 2001-05-16 15:40:51 +0000 | [diff] [blame] | 1 | /* vi: set sw=4 ts=4: */ |
| 2 | /* |
| 3 | * Mini xgethostbyname implementation. |
| 4 | * |
Matt Kraai | c55b8d4 | 2001-05-16 15:40:51 +0000 | [diff] [blame] | 5 | * Copyright (C) 2001 Matt Kraai <kraai@alumni.carnegiemellon.edu>. |
| 6 | * |
Denys Vlasenko | 0ef64bd | 2010-08-16 20:14:46 +0200 | [diff] [blame] | 7 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
Matt Kraai | c55b8d4 | 2001-05-16 15:40:51 +0000 | [diff] [blame] | 8 | */ |
Matt Kraai | 8f7a4ad | 2001-05-16 17:05:03 +0000 | [diff] [blame] | 9 | #include "libbb.h" |
| 10 | |
Denis Vlasenko | defc1ea | 2008-06-27 02:52:20 +0000 | [diff] [blame] | 11 | struct hostent* FAST_FUNC xgethostbyname(const char *name) |
Matt Kraai | c55b8d4 | 2001-05-16 15:40:51 +0000 | [diff] [blame] | 12 | { |
Denis Vlasenko | 5e618ff | 2006-11-21 20:35:22 +0000 | [diff] [blame] | 13 | struct hostent *retval = gethostbyname(name); |
| 14 | if (!retval) |
James Byrne | 6937487 | 2019-07-02 11:35:03 +0200 | [diff] [blame] | 15 | bb_simple_herror_msg_and_die(name); |
Matt Kraai | c55b8d4 | 2001-05-16 15:40:51 +0000 | [diff] [blame] | 16 | return retval; |
| 17 | } |