]> gcc.gnu.org Git - gcc.git/commit
[Ada] Support for local unix sockets in GNAT.Sockets API
authorDmitriy Anisimkov <anisimko@adacore.com>
Tue, 17 Sep 2019 07:59:23 +0000 (07:59 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 17 Sep 2019 07:59:23 +0000 (07:59 +0000)
commit38c4e50d8c738553de6f5e7a5fee3b55728ea457
tree12f8f4d4fe58df84863fd3f7203becd9106b0dbf
parent37915d022449d21fe7bfa7db640a15e77cd3352e
[Ada] Support for local unix sockets in GNAT.Sockets API

Sock_Addr_Type has Family_Unix variant now. This variant can be created
with function Unix_Local_Addr call. And this variant is working in
GNAT.Socket routines where it is appropriate.

2019-09-17  Dmitriy Anisimkov  <anisimko@adacore.com>

gcc/ada/

* gsocket.h: Include sys/un.h.
* s-oscons-tmplt.c (AF_UNIX): New constant generation.
(SIZEOF_sockaddr_un): Idem.
* libgnat/g-socket.ads (Family_Type): New value Family_Unix
added.
(Family_Inet_4_6): New subtype only for network families.
(Sock_Addr_Type): Add Unbounded_String field for Family_Unix
variant.
(Unix_Socket_Address): Create Sock_Addr_Type from socket
pathname.
(Network_Socket_Address): Create Sock_Addr_Type from
Inet_Addr_Type and Port_Type parameters.
* libgnat/g-socket.adb: Support local unix address in socket
routines.
(Get_Address_Info): Disable warning about Result may be
referenced before it has a value. Remove duplicated code to exit
from Look_For_Supported.
* libgnat/g-sothco.ads (Unix_Name_Length): New constant defining
maximum number of characters in local socket address path.
(Sockaddr): Add variant for Family_Unix address family. Move
Sin_Port and Sin_Family to Family_Inet section. Add Sin6_Port
and Sin6_Family to Family_Inet6 section.
(Set_Address): Add out parameter Length to return valuable
Sockaddr data length.
(Get_Address): Add input parameter Length to set valuable
Sockaddr data length.
* libgnat/g-sothco.adb: Support local unix address in socket
routines.

From-SVN: r275770
gcc/ada/ChangeLog
gcc/ada/gsocket.h
gcc/ada/libgnat/g-socket.adb
gcc/ada/libgnat/g-socket.ads
gcc/ada/libgnat/g-sothco.adb
gcc/ada/libgnat/g-sothco.ads
gcc/ada/s-oscons-tmplt.c
This page took 0.059493 seconds and 5 git commands to generate.