glibc/include/resolv.h
Joseph Myers 754034c429 Obsolete p_secstodate.
This patch, relative to a tree with
<https://sourceware.org/ml/libc-alpha/2017-11/msg00797.html> (pending
review) applied, obsoletes p_secstodate, making the underlying
function __p_secstodate into a compat symbol not available for new
binaries or ports.  The calls in ns_print.c (part of incomplete
handling of TKEY) are changed to use %lu to print times instead of
trying to pretty-print the times any more.

Tested for x86_64.

	* resolv/res_debug.c (p_secstodate): Condition definition on
	[SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_27)].  Define
	directly as __p_secstodate, and as a compat symbol.  Do not use
	libresolv_hidden_def.
	* resolv/resolv.h (p_secstodate): Remove macro and function
	declaration.
	* resolv/ns_print.c (ns_sprintrrf): Print times with %lu, not
	using p_secstodate.
	* include/resolv.h (__p_secstodate): Do not use
	libresolv_hidden_proto.
	* resolv/Makefile (tests): Move tst-p_secstodate to ....
	(tests-internal): ... here.
	* resolv/tst-p_secstodate.c: Include <shlib-compat.h>.  Condition
	all contents on [TEST_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_27)]
	and declare and use __p_secstodate and use compat_symbol_reference
	in that case.
	[!TEST_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_27)] (do_test): Add
	implementation returning 77.
2017-11-22 22:21:10 +00:00

71 lines
2.2 KiB
C

#ifndef _RESOLV_H_
# ifndef _ISOMAC
# include <stdbool.h>
# define RES_SET_H_ERRNO(r,x) \
do \
{ \
(r)->res_h_errno = x; \
__set_h_errno(x); \
} \
while (0)
# endif
#include <resolv/resolv.h>
# if defined _RESOLV_H_ && !defined _ISOMAC
# if IS_IN (libc)
# define __resp __libc_resp
# endif
extern __thread struct __res_state *__resp attribute_tls_model_ie;
# undef _res
# define _res (*__resp)
/* Now define the internal interfaces. */
extern int __res_vinit (res_state, int) attribute_hidden;
extern void _sethtent (int);
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 uint32_t _getlong (const unsigned char *__src);
extern uint16_t _getshort (const unsigned char *__src);
extern int res_ourserver_p (const res_state __statp,
const struct sockaddr_in6 *__inp);
extern void __res_iclose (res_state statp, bool free_addr);
libc_hidden_proto (__res_ninit)
libc_hidden_proto (__res_nclose)
libc_hidden_proto (__res_iclose)
libc_hidden_proto (__res_randomid)
libc_hidden_proto (__res_state)
libresolv_hidden_proto (_sethtent)
libresolv_hidden_proto (_gethtent)
libresolv_hidden_proto (_gethtbyaddr)
libresolv_hidden_proto (_gethtbyname2)
libresolv_hidden_proto (__dn_expand)
libresolv_hidden_proto (__dn_comp)
libresolv_hidden_proto (__dn_skipname)
libresolv_hidden_proto (__res_hnok)
libresolv_hidden_proto (__res_dnok)
libresolv_hidden_proto (__putlong)
libresolv_hidden_proto (__putshort)
libresolv_hidden_proto (__p_cdnname)
libresolv_hidden_proto (__p_fqnname)
libresolv_hidden_proto (__p_option)
libresolv_hidden_proto (__sym_ntos)
libresolv_hidden_proto (__p_rcode)
libresolv_hidden_proto (__p_class)
libresolv_hidden_proto (__p_type)
libresolv_hidden_proto (__loc_ntoa)
libresolv_hidden_proto (__fp_nquery)
libresolv_hidden_proto (__fp_query)
libresolv_hidden_proto (__res_nameinquery)
libresolv_hidden_proto (__res_queriesmatch)
libresolv_hidden_proto (__b64_ntop)
libresolv_hidden_proto (__dn_count_labels)
# endif /* _RESOLV_H_ && !_ISOMAC */
#endif