aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Bernardi <bernardi@adacore.com>2019-08-19 08:36:26 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-19 08:36:26 +0000
commit593e0eba77594774db054cd98b879fbe1ffa29cc (patch)
tree5b6ddcb1819d8535ade0d13ffef13d671e7f195d
parent1f5c7ba85856618c1f14d4f581966baadbe02ddd (diff)
downloadgcc-593e0eba77594774db054cd98b879fbe1ffa29cc.zip
gcc-593e0eba77594774db054cd98b879fbe1ffa29cc.tar.gz
gcc-593e0eba77594774db054cd98b879fbe1ffa29cc.tar.bz2
[Ada] Enable use of GNAT.Sockets for VxWorks RTP
The recent introduction of GNAT.Sockets IPv6 support broke support for VxWorks RTPs due to the use of internal VxWorks kernel calls. This patch rectifies this by using the VxWorks public API for these routines. The following RTP should compile successfully on a Development profile VxWorks kernel that includes the INCLUDE_GETNAMEINFO component: with GNAT.Sockets; use GNAT.Sockets; procedure IPvX is procedure Print_Address_Info (Host, Serv : String; Family : Family_Type := Family_Unspec) is Addresses : Address_Info_Array := Get_Address_Info (Host, Serv, Family, Passive => False, Numeric_Host => False); begin Sort (Addresses, IPv6_TCP_Preferred'Access); end Print_Address_Info; begin Print_Address_Info ("localhost", "ssh"); end IPvX; 2019-08-19 Patrick Bernardi <bernardi@adacore.com> gcc/ada/ * socket.c: Removed the redefinition of getaddrinfo, getnameinfo and freeaddrinfo to internal VxWorks kernel calls because they are, well, internal kernel calls and cannot be called from RTPs. VxWorks provides the necessary components to call these routines directly. From-SVN: r274651
-rw-r--r--gcc/ada/ChangeLog8
-rw-r--r--gcc/ada/socket.c6
2 files changed, 8 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 5d48b3d..f89468e 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,11 @@
+2019-08-19 Patrick Bernardi <bernardi@adacore.com>
+
+ * socket.c: Removed the redefinition of getaddrinfo, getnameinfo
+ and freeaddrinfo to internal VxWorks kernel calls because they
+ are, well, internal kernel calls and cannot be called from RTPs.
+ VxWorks provides the necessary components to call these routines
+ directly.
+
2019-08-19 Eric Botcazou <ebotcazou@adacore.com>
* exp_dist.adb (Is_Generic_Actual_Subtype): New predicate.
diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
index 8fc8415..94538d4 100644
--- a/gcc/ada/socket.c
+++ b/gcc/ada/socket.c
@@ -704,12 +704,6 @@ __gnat_servent_s_proto (struct servent * s)
#if defined(AF_INET6) && !defined(__rtems__)
-#if defined (__vxworks)
-#define getaddrinfo ipcom_getaddrinfo
-#define getnameinfo ipcom_getnameinfo
-#define freeaddrinfo ipcom_freeaddrinfo
-#endif
-
int __gnat_getaddrinfo(
const char *node,
const char *service,