Back to index

glibc  2.9
gethstbynm3_r.c
Go to the documentation of this file.
00001 /* Copyright (C) 1996-1998, 2000, 2005, 2007 Free Software Foundation, Inc.
00002    This file is part of the GNU C Library.
00003    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
00004 
00005    This program is free software; you can redistribute it and/or modify
00006    it under the terms of the GNU General Public License as published
00007    by the Free Software Foundation; version 2 of the License, or
00008    (at your option) any later version.
00009 
00010    This program is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013    GNU General Public License for more details.
00014 
00015    You should have received a copy of the GNU General Public License
00016    along with this program; if not, write to the Free Software Foundation,
00017    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
00018 
00019 #include <ctype.h>
00020 #include <errno.h>
00021 #include <netdb.h>
00022 #include <string.h>
00023 #include <arpa/inet.h>
00024 #include <netinet/in.h>
00025 
00026 
00027 #define LOOKUP_TYPE  struct hostent
00028 #define FUNCTION_NAME       gethostbyname3
00029 #define FUNCTION2_NAME      gethostbyname2
00030 #define DATABASE_NAME       hosts
00031 #define ADD_PARAMS   const char *name, int af
00032 #define EXTRA_PARAMS , int32_t *ttlp, char **canonp
00033 #define ADD_VARIABLES       name, af
00034 #define EXTRA_VARIABLES     , ttlp, canonp
00035 #define NEED_H_ERRNO 1
00036 #define NEED__RES_HCONF 1
00037 
00038 #define HANDLE_DIGITS_DOTS  1
00039 #define HAVE_LOOKUP_BUFFER  1
00040 #define HAVE_AF                    1
00041 
00042 #define __inet_aton inet_aton
00043 
00044 #include "../nss/getXXbyYY_r.c"
00045 
00046 
00047 int
00048 __gethostbyname2_r (const char *name, int af, struct hostent *ret, char *buf,
00049                   size_t buflen, struct hostent **result, int *h_errnop)
00050 {
00051   return __gethostbyname3_r (name, af, ret, buf, buflen, result, h_errnop,
00052                           NULL, NULL);
00053 }