]>
Commit | Line | Data |
---|---|---|
688903eb | 1 | /* Copyright (C) 1996-2018 Free Software Foundation, Inc. |
67479a70 UD |
2 | This file is part of the GNU C Library. |
3 | Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996. | |
4 | ||
43bc8ac6 | 5 | This program is free software; you can redistribute it and/or modify |
2e2efe65 RM |
6 | it under the terms of the GNU General Public License as published |
7 | by the Free Software Foundation; version 2 of the License, or | |
8 | (at your option) any later version. | |
67479a70 | 9 | |
43bc8ac6 | 10 | This program is distributed in the hope that it will be useful, |
67479a70 | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
43bc8ac6 UD |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 | GNU General Public License for more details. | |
67479a70 | 14 | |
43bc8ac6 | 15 | You should have received a copy of the GNU General Public License |
59ba27a6 | 16 | along with this program; if not, see <http://www.gnu.org/licenses/>. */ |
67479a70 UD |
17 | |
18 | #include <ctype.h> | |
19 | #include <errno.h> | |
20 | #include <netdb.h> | |
21 | #include <string.h> | |
22 | #include <arpa/inet.h> | |
23 | #include <netinet/in.h> | |
24 | ||
25 | ||
26 | #define LOOKUP_TYPE struct hostent | |
384ca551 UD |
27 | #define FUNCTION_NAME gethostbyname3 |
28 | #define FUNCTION2_NAME gethostbyname2 | |
67479a70 UD |
29 | #define DATABASE_NAME hosts |
30 | #define ADD_PARAMS const char *name, int af | |
384ca551 | 31 | #define EXTRA_PARAMS , int32_t *ttlp, char **canonp |
67479a70 | 32 | #define ADD_VARIABLES name, af |
384ca551 | 33 | #define EXTRA_VARIABLES , ttlp, canonp |
67479a70 | 34 | #define NEED_H_ERRNO 1 |
e6b4e2de | 35 | #define NEED__RES 1 |
67479a70 UD |
36 | |
37 | #define HANDLE_DIGITS_DOTS 1 | |
38 | #define HAVE_LOOKUP_BUFFER 1 | |
39 | #define HAVE_AF 1 | |
40 | ||
9ffec5b2 UD |
41 | #define __inet_aton inet_aton |
42 | ||
f04e2132 RM |
43 | /* We are nscd, so we don't want to be talking to ourselves. */ |
44 | #undef USE_NSCD | |
45 | ||
67479a70 | 46 | #include "../nss/getXXbyYY_r.c" |
384ca551 UD |
47 | |
48 | ||
49 | int | |
50 | __gethostbyname2_r (const char *name, int af, struct hostent *ret, char *buf, | |
51 | size_t buflen, struct hostent **result, int *h_errnop) | |
52 | { | |
53 | return __gethostbyname3_r (name, af, ret, buf, buflen, result, h_errnop, | |
54 | NULL, NULL); | |
55 | } |