summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorocielliottc <elliottc@objectcomputing.com>2022-10-14 06:04:13 -0500
committerGitHub <noreply@github.com>2022-10-14 06:04:13 -0500
commitf4512003c2fd03a7471c98a3a56a36353bfef15d (patch)
treef8c6dc619c992de539da66ea23a6eaba85bb735b
parentf63ede24b58993e439c94cf8a3b01773debfba17 (diff)
parentdb4f0fb92002573b6b0c571d891ea9fe4e3706be (diff)
downloadATCD-f4512003c2fd03a7471c98a3a56a36353bfef15d.tar.gz
Merge pull request #1965 from DOCGroup/ocielliottc/a6t2-merge
Merged pull requests 1953 and 1955-1958
-rw-r--r--ACE/ace/OS_NS_arpa_inet.cpp2
-rw-r--r--ACE/ace/OS_NS_netdb.inl11
-rw-r--r--ACE/ace/SOCK_Dgram_Mcast.cpp2
-rw-r--r--ACE/ace/os_include/os_netdb.h14
4 files changed, 23 insertions, 6 deletions
diff --git a/ACE/ace/OS_NS_arpa_inet.cpp b/ACE/ace/OS_NS_arpa_inet.cpp
index 0cc14c302b8..c6ac255f461 100644
--- a/ACE/ace/OS_NS_arpa_inet.cpp
+++ b/ACE/ace/OS_NS_arpa_inet.cpp
@@ -85,7 +85,7 @@ ACE_OS::inet_aton (const char *host_name, struct in_addr *addr)
return 1;
}
# endif // ACE_LACKS_INET_ADDR
-#elif defined (ACE_VXWORKS)
+#elif defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x700)
// inet_aton() returns OK (0) on success and ERROR (-1) on failure.
// Must reset errno first. Refer to WindRiver SPR# 34949, SPR# 36026
::errnoSet(0);
diff --git a/ACE/ace/OS_NS_netdb.inl b/ACE/ace/OS_NS_netdb.inl
index 5f4e4c258e9..b3c765653a9 100644
--- a/ACE/ace/OS_NS_netdb.inl
+++ b/ACE/ace/OS_NS_netdb.inl
@@ -53,7 +53,7 @@ ACE_OS::gethostbyaddr (const char *addr, int length, int type)
if (0 == addr || '\0' == addr[0])
return 0;
-# if defined (ACE_VXWORKS)
+# if defined (ACE_VXWORKS_HAS_GETHOSTBYADDR_REENTRANT)
// VxWorks 6.x has a gethostbyaddr() that is threadsafe and
// returns an heap-allocated hostentry structure.
// just call ACE_OS::gethostbyaddr_r () which knows how to handle this.
@@ -134,7 +134,7 @@ ACE_OS::gethostbyaddr_r (const char *addr,
//FUZZ: enable check_for_lack_ACE_OS
else
return (struct hostent *) 0;
-# elif defined (ACE_VXWORKS)
+# elif defined (ACE_VXWORKS_HAS_GETHOSTBYADDR_REENTRANT)
ACE_UNUSED_ARG (h_errnop);
// VxWorks 6.x has a threadsafe gethostbyaddr() which returns a heap-allocated
// data structure which needs to be freed with hostentFree()
@@ -238,10 +238,12 @@ ACE_OS::gethostbyname (const char *name)
if (0 == name || '\0' == name[0])
return 0;
-# if defined (ACE_VXWORKS)
+# if defined (ACE_VXWORKS_HAS_GETHOSTBYNAME_REENTRANT)
// VxWorks 6.x has a gethostbyname() that is threadsafe and
// returns an heap-allocated hostentry structure.
// just call ACE_OS::gethostbyname_r () which knows how to handle this.
+ // With VxWorks 7 it depends on the GETHOSTBYNAME_REENTRANT
+ // define
struct hostent hentry;
ACE_HOSTENT_DATA buf;
int h_error; // Not the same as errno!
@@ -318,10 +320,11 @@ ACE_OS::gethostbyname_r (const char *name,
//FUZZ: enable check_for_lack_ACE_OS
else
return (struct hostent *) 0;
-# elif defined (ACE_VXWORKS)
+# elif defined (ACE_VXWORKS_HAS_GETHOSTBYNAME_REENTRANT)
ACE_UNUSED_ARG (h_errnop);
// VxWorks 6.x has a threadsafe gethostbyname() which returns a heap-allocated
// data structure which needs to be freed with hostentFree()
+ // With VxWorks 7 it depends on the GETHOSTBYNAME_REENTRANT macro
//FUZZ: disable check_for_lack_ACE_OS
struct hostent* hp = ::gethostbyname (name);
//FUZZ: enable check_for_lack_ACE_OS
diff --git a/ACE/ace/SOCK_Dgram_Mcast.cpp b/ACE/ace/SOCK_Dgram_Mcast.cpp
index 4b669591a4f..1cfc23e8e47 100644
--- a/ACE/ace/SOCK_Dgram_Mcast.cpp
+++ b/ACE/ace/SOCK_Dgram_Mcast.cpp
@@ -18,7 +18,7 @@
#endif
#if defined (ACE_HAS_GETIFADDRS)
-# if defined (ACE_VXWORKS)
+# if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x700)
# include /**/ <net/ifaddrs.h>
# else
# include /**/ <ifaddrs.h>
diff --git a/ACE/ace/os_include/os_netdb.h b/ACE/ace/os_include/os_netdb.h
index 320e8f191b4..de509b4cbc7 100644
--- a/ACE/ace/os_include/os_netdb.h
+++ b/ACE/ace/os_include/os_netdb.h
@@ -36,6 +36,20 @@ extern "C"
# include /**/ <netdb.h>
#endif /* !ACE_LACKS_NETDB_H */
+#if defined (ACE_VXWORKS)
+# include /**/ <hostLib.h>
+# if (ACE_VXWORKS < 0x700) || defined (GETHOSTBYNAME_REENTRANT)
+// With VxWorks 7 hostLib.h defines GETHOSTBYNAME_REENTRANT when gethostbyname()
+// is reentrant
+# define ACE_VXWORKS_HAS_GETHOSTBYNAME_REENTRANT
+# endif
+# if (ACE_VXWORKS < 0x700) || defined (GETHOSTBYADDR_REENTRANT)
+// With VxWorks 7 hostLib.h defines GETHOSTBYADDR_REENTRANT when gethostbyaddr()
+// is reentrant
+# define ACE_VXWORKS_HAS_GETHOSTBYADDR_REENTRANT
+# endif
+#endif /* ACE_VXWORKS */
+
#if defined (ACE_LACKS_HOSTENT)
struct hostent {
char *h_name; /* official name of host */