mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-28 04:03:35 +08:00
0420d8885a
2002-10-15 Jakub Jelinek <jakub@redhat.com> * include/resolv.h (__libc_res_nquery, __libc_res_nsearch, __libc_res_nsend): New prototypes. * resolv/res_query.c (QUERYSIZE): Define. (__libc_res_nquery): Renamed from res_nquery. Added answerp argument. Allocate only QUERYSIZE bytes first, if res_nmkquery fails use MAXPACKET buffer. Call __libc_res_nsend instead of res_nsend, pass answerp. (res_nquery): Changed into wrapper around __libc_res_nquery. (__libc_res_nsearch): Renamed from res_nsearch. Added answerp argument. Call __libc_res_nquerydomain and __libc_res_nquery instead of the non-__libc_ variants, pass them answerp. (res_nsearch): Changed into wrapper around __libc_res_nsearch. (__libc_res_nquerydomain): Renamed from res_nquerydomain. Added answerp argument. Call __libc_res_nquery instead of res_nquery, pass answerp. (res_nquerydomain): Changed into wrapper around __libc_res_nquerydomain. * resolv/res_send.c: Include sys/ioctl.h. (MAXPACKET): Define. (send_vc): Change arguments. Reallocate answer buffer if it is too small. (send_dg): Likewise. (__libc_res_nsend): Renamed from res_nsend. Added ansp argument. Reallocate answer buffer if it is too small and hooks are in use. Adjust calls to send_vc and send_dg. (res_nsend): Changed into wrapper around __libc_res_nsend. * resolv/nss_dns/dns-host.c (_nss_dns_gethostbyname2_r): Allocate just 1K answer buffer on the stack, use __libc_res_nsearch instead of res_nsearch. (_nss_dns_gethostbyaddr_r): Similarly with __libc_res_nquery. * resolv/nss_dns/dns-network.c (_nss_dns_getnetbyaddr_r): Likewise. (_nss_dns_getnetbyname_r): Similarly with __libc_res_nsearch. * resolv/gethnamaddr.c (gethostbyname2): Likewise. (gethostbyaddr): Similarly with __libc_res_nquery. * resolv/Versions (libresolv): Export __libc_res_nquery and __libc_res_nsearch at GLIBC_PRIVATE.
61 lines
1.6 KiB
C
61 lines
1.6 KiB
C
#ifndef _RESOLV_H_
|
|
|
|
#define RES_SET_H_ERRNO(r,x) \
|
|
do \
|
|
{ \
|
|
(r)->res_h_errno = x; \
|
|
__set_h_errno(x); \
|
|
} \
|
|
while (0)
|
|
|
|
#include <resolv/resolv.h>
|
|
|
|
#ifdef _RESOLV_H_
|
|
|
|
# ifdef _LIBC_REENTRANT
|
|
# include <tls.h>
|
|
# if USE___THREAD
|
|
# undef _res
|
|
# ifndef NOT_IN_libc
|
|
# define _res __libc_res
|
|
# endif
|
|
extern __thread struct __res_state _res attribute_tls_model_ie;
|
|
# endif
|
|
# else
|
|
# ifndef __BIND_NOSTATIC
|
|
# undef _res
|
|
extern struct __res_state _res;
|
|
# endif
|
|
# endif
|
|
|
|
/* Now define the internal interfaces. */
|
|
extern int __res_vinit (res_state, int);
|
|
extern void _sethtent (int);
|
|
extern void _endhtent (void);
|
|
extern struct hostent *_gethtent (void);
|
|
extern struct hostent *_gethtbyname (const char *__name);
|
|
extern struct hostent *_gethtbyname2 (const char *__name, int __af);
|
|
struct hostent *_gethtbyaddr (const char *addr, size_t __len, int __af);
|
|
extern u_int32_t _getlong (const u_char *__src);
|
|
extern u_int16_t _getshort (const u_char *__src);
|
|
extern void res_pquery (const res_state __statp, const u_char *__msg,
|
|
int __len, FILE *__file);
|
|
extern void res_send_setqhook (res_send_qhook __hook);
|
|
extern void res_send_setrhook (res_send_rhook __hook);
|
|
extern int res_ourserver_p (const res_state __statp,
|
|
const struct sockaddr_in6 *__inp);
|
|
libc_hidden_proto (__res_ninit)
|
|
libc_hidden_proto (__res_randomid)
|
|
|
|
int __libc_res_nquery (res_state, const char *, int, int, u_char *, int,
|
|
u_char **);
|
|
int __libc_res_nsearch (res_state, const char *, int, int, u_char *, int,
|
|
u_char **);
|
|
int __libc_res_nsend (res_state, const u_char *, int, u_char *, int,
|
|
u_char **)
|
|
attribute_hidden;
|
|
|
|
#endif
|
|
|
|
#endif
|