2 * This file is a ghastly hack because nobody can agree on
3 * gethostbyname_r()'s prototype.
5 * Copyright (C) 2001,2002 Brian Stafford <brian@stafford.uklinux.net>
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 /*************************************************************************
26 #include "gethostbyname.h"
33 hp = gethostbyname_ctx (host, &ctx);
37 handle_value_of_errno (errno);
39 handle_value_of_h_errno (h_error_ctx (&ctx));
47 *************************************************************************/
49 #ifndef _gethostbyname_h
50 #define _gethostbyname_h
52 #if HAVE_GETIPNODEBYNAME
57 struct hostent *hostent;
60 #elif HAVE_GETHOSTBYNAME_R == 6
65 struct hostent hostent;
70 #elif HAVE_GETHOSTBYNAME_R == 5
75 struct hostent hostent;
80 #elif HAVE_GETHOSTBYNAME_R == 3
85 struct hostent_data hostent_data;
86 struct hostent hostent;
98 struct hostent *gethostbyname_ctx (const char *host, struct ghbnctx *ctx);
99 int h_error_ctx (struct ghbnctx *ctx);
100 void free_ghbnctx (struct ghbnctx *ctx);