netdb.cc
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1996-2025 The Squid Software Foundation and contributors
3  *
4  * Squid software is distributed under GPLv2+ license and includes
5  * contributions from numerous individuals and organizations.
6  * Please see the COPYING and CONTRIBUTORS files for details.
7  */
8 
9 #include "squid.h"
10 
11 #if _SQUID_WINDOWS_ || _SQUID_MINGW_
12 
13 #include "compat/netdb.h"
14 #include "compat/wserrno.h"
15 
16 struct hostent *
17 xgethostbyname(const char * const name)
18 {
19  const auto result = gethostbyname(name);
20  if (!result)
21  SetErrnoFromWsaError();
22  return result;
23 }
24 
25 struct servent *
26 xgetservbyname(const char * const name, const char * const proto)
27 {
28  const auto result = getservbyname(name, proto);
29  if (!result)
30  SetErrnoFromWsaError();
31  return result;
32 }
33 
34 #endif /* _SQUID_WINDOWS_ || _SQUID_MINGW_ */
struct hostent * xgethostbyname(const char *name)
POSIX gethostbyname(3) equivalent.
Definition: netdb.h:25
struct servent * xgetservbyname(const char *name, const char *proto)
POSIX getservbyname(3) equivalent.
Definition: netdb.h:31

 

Introduction

Documentation

Support

Miscellaneous