diff options
author | Dmitriy Anisimkov <anisimko@adacore.com> | 2019-09-17 07:59:23 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-09-17 07:59:23 +0000 |
commit | 38c4e50d8c738553de6f5e7a5fee3b55728ea457 (patch) | |
tree | 12f8f4d4fe58df84863fd3f7203becd9106b0dbf /gcc/ada/adaint.c | |
parent | 37915d022449d21fe7bfa7db640a15e77cd3352e (diff) | |
download | gcc-38c4e50d8c738553de6f5e7a5fee3b55728ea457.zip gcc-38c4e50d8c738553de6f5e7a5fee3b55728ea457.tar.gz gcc-38c4e50d8c738553de6f5e7a5fee3b55728ea457.tar.bz2 |
[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
Diffstat (limited to 'gcc/ada/adaint.c')
0 files changed, 0 insertions, 0 deletions