libc/resolv: Drop Solaris 2 compatibility

MFC after:	1 week
Reviewed by:	kevans, markj
Differential Revision:	https://reviews.freebsd.org/D57922
This commit is contained in:
Dag-Erling Smørgrav committed 2026-07-06 14:23:24 +02:00
1 parent 4319e4bf42
commit aba9fffebf
3 files changed
-58

No files matched your search

-5
View File
@@ -38,12 +38,7 @@ static void setsection(ns_msg *msg, ns_sect sect);
/* Macros. */
#if !defined(SOLARIS2) || defined(__COVERITY__)
#define RETERR(err) do { errno = (err); return (-1); } while (0)
#else
#define RETERR(err) \
do { errno = (err); if (errno == errno) return (-1); } while (0)
#endif
#define PARSE_FMT_PRESO 0 /* Parse using presentation-format names */
#define PARSE_FMT_WIRE 1 /* Parse using network-format names */
-11
View File
@@ -240,17 +240,6 @@ res_dnok(const char *dn) {
* Note that one _ comes from C and the others come from us.
*/
#ifdef SOLARIS2
#ifdef __putlong
#undef __putlong
#endif
#ifdef __putshort
#undef __putshort
#endif
#pragma weak putlong = __putlong
#pragma weak putshort = __putshort
#endif /* SOLARIS2 */
void __putlong(u_int32_t src, u_char *dst) { ns_put32(src, dst); }
void __putshort(u_int16_t src, u_char *dst) { ns_put16(src, dst); }
#ifndef __ultrix__
-42
View File
@@ -95,10 +95,6 @@
#include "res_private.h"
#ifdef SOLARIS2
#include <sys/systeminfo.h>
#endif
static void res_setoptions(res_state, const char *, const char *);
#ifdef RESOLVSORT
@@ -219,28 +215,6 @@ __res_vinit(res_state statp, int preinit) {
#endif
res_setservers(statp, u, nitems(u));
#ifdef SOLARIS2
/*
* The old libresolv derived the defaultdomain from NIS/NIS+.
* We want to keep this behaviour
*/
{
char buf[sizeof(statp->defdname)], *cp;
int ret;
if ((ret = sysinfo(SI_SRPC_DOMAIN, buf, sizeof(buf))) > 0 &&
(unsigned int)ret <= sizeof(buf)) {
if (buf[0] == '+')
buf[0] = '.';
cp = strchr(buf, '.');
cp = (cp == NULL) ? buf : (cp + 1);
strncpy(statp->defdname, cp,
sizeof(statp->defdname) - 1);
statp->defdname[sizeof(statp->defdname) - 1] = '\0';
}
}
#endif /* SOLARIS2 */
/* Allow user to override the local domain definition */
if ((cp = secure_getenv("LOCALDOMAIN")) != NULL) {
(void)strncpy(statp->defdname, cp, sizeof(statp->defdname) - 1);
@@ -580,22 +554,6 @@ res_setoptions(res_state statp, const char *options, const char *source)
if (statp->options & RES_DEBUG)
printf(";;\ttimeout=%d\n", statp->retrans);
#endif
#ifdef SOLARIS2
} else if (!strncmp(cp, "retrans:", sizeof("retrans:") - 1)) {
/*
* For backward compatibility, 'retrans' is
* supported as an alias for 'timeout', though
* without an imposed maximum.
*/
statp->retrans = atoi(cp + sizeof("retrans:") - 1);
} else if (!strncmp(cp, "retry:", sizeof("retry:") - 1)){
/*
* For backward compatibility, 'retry' is
* supported as an alias for 'attempts', though
* without an imposed maximum.
*/
statp->retry = atoi(cp + sizeof("retry:") - 1);
#endif /* SOLARIS2 */
} else if (!strncmp(cp, "attempts:", sizeof("attempts:") - 1)){
i = atoi(cp + sizeof("attempts:") - 1);
if (i <= RES_MAXRETRY)