Commit 62b7afe9 by Thomas Quinot Committed by Arnaud Charlet

g-soccon.ads: New file.

2008-08-08  Thomas Quinot  <quinot@adacore.com>

	* g-soccon.ads: New file.

	* g-stheme.adb, g-socthi-vms.adb, g-socthi-vxworks.adb,
	g-socthi-mingw.adb, g-sttsne-vxworks.adb, g-socthi.adb,
	g-stsifd-sockets.adb, g-socket.adb, g-socket.ads,
	g-sothco.adb, g-sothco.ads: Add back GNAT.Sockets.Constants as a child
	unit, to allow building software that depends on this internal unit
	with both older and newer compilers.

From-SVN: r138877
parent d65251b8
------------------------------------------------------------------------------
-- --
-- GNAT COMPILER COMPONENTS --
-- --
-- G N A T . S O C K E T S . C O N S T A N T S --
-- --
-- S p e c --
-- --
-- Copyright (C) 2000-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 51 Franklin Street, Fifth Floor, --
-- Boston, MA 02110-1301, USA. --
-- --
-- As a special exception, if other files instantiate generics from this --
-- unit, or you link this unit with other files to produce an executable, --
-- this unit does not by itself cause the resulting executable to be --
-- covered by the GNU General Public License. This exception does not --
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
-- GNAT was originally developed by the GNAT team at New York University. --
-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
-- This package provides a temporary compatibility renaming for deprecated
-- internal package GNAT.Sockets.Constants.
-- This package should not be directly used by an applications program.
-- It is a compatibility artefact to help building legacy code with newer
-- compilers, and will be removed at some point in the future.
with System.OS_Constants;
package GNAT.Sockets.Constants renames System.OS_Constants;
...@@ -58,7 +58,7 @@ package body GNAT.Sockets is ...@@ -58,7 +58,7 @@ package body GNAT.Sockets is
ENOERROR : constant := 0; ENOERROR : constant := 0;
Netdb_Buffer_Size : constant := Constants.Need_Netdb_Buffer * 1024; Netdb_Buffer_Size : constant := SOSC.Need_Netdb_Buffer * 1024;
-- The network database functions gethostbyname, gethostbyaddr, -- The network database functions gethostbyname, gethostbyaddr,
-- getservbyname and getservbyport can either be guaranteed task safe by -- getservbyname and getservbyport can either be guaranteed task safe by
-- the operating system, or else return data through a user-provided buffer -- the operating system, or else return data through a user-provided buffer
...@@ -67,49 +67,49 @@ package body GNAT.Sockets is ...@@ -67,49 +67,49 @@ package body GNAT.Sockets is
-- Correspondence tables -- Correspondence tables
Levels : constant array (Level_Type) of C.int := Levels : constant array (Level_Type) of C.int :=
(Socket_Level => Constants.SOL_SOCKET, (Socket_Level => SOSC.SOL_SOCKET,
IP_Protocol_For_IP_Level => Constants.IPPROTO_IP, IP_Protocol_For_IP_Level => SOSC.IPPROTO_IP,
IP_Protocol_For_UDP_Level => Constants.IPPROTO_UDP, IP_Protocol_For_UDP_Level => SOSC.IPPROTO_UDP,
IP_Protocol_For_TCP_Level => Constants.IPPROTO_TCP); IP_Protocol_For_TCP_Level => SOSC.IPPROTO_TCP);
Modes : constant array (Mode_Type) of C.int := Modes : constant array (Mode_Type) of C.int :=
(Socket_Stream => Constants.SOCK_STREAM, (Socket_Stream => SOSC.SOCK_STREAM,
Socket_Datagram => Constants.SOCK_DGRAM); Socket_Datagram => SOSC.SOCK_DGRAM);
Shutmodes : constant array (Shutmode_Type) of C.int := Shutmodes : constant array (Shutmode_Type) of C.int :=
(Shut_Read => Constants.SHUT_RD, (Shut_Read => SOSC.SHUT_RD,
Shut_Write => Constants.SHUT_WR, Shut_Write => SOSC.SHUT_WR,
Shut_Read_Write => Constants.SHUT_RDWR); Shut_Read_Write => SOSC.SHUT_RDWR);
Requests : constant array (Request_Name) of C.int := Requests : constant array (Request_Name) of C.int :=
(Non_Blocking_IO => Constants.FIONBIO, (Non_Blocking_IO => SOSC.FIONBIO,
N_Bytes_To_Read => Constants.FIONREAD); N_Bytes_To_Read => SOSC.FIONREAD);
Options : constant array (Option_Name) of C.int := Options : constant array (Option_Name) of C.int :=
(Keep_Alive => Constants.SO_KEEPALIVE, (Keep_Alive => SOSC.SO_KEEPALIVE,
Reuse_Address => Constants.SO_REUSEADDR, Reuse_Address => SOSC.SO_REUSEADDR,
Broadcast => Constants.SO_BROADCAST, Broadcast => SOSC.SO_BROADCAST,
Send_Buffer => Constants.SO_SNDBUF, Send_Buffer => SOSC.SO_SNDBUF,
Receive_Buffer => Constants.SO_RCVBUF, Receive_Buffer => SOSC.SO_RCVBUF,
Linger => Constants.SO_LINGER, Linger => SOSC.SO_LINGER,
Error => Constants.SO_ERROR, Error => SOSC.SO_ERROR,
No_Delay => Constants.TCP_NODELAY, No_Delay => SOSC.TCP_NODELAY,
Add_Membership => Constants.IP_ADD_MEMBERSHIP, Add_Membership => SOSC.IP_ADD_MEMBERSHIP,
Drop_Membership => Constants.IP_DROP_MEMBERSHIP, Drop_Membership => SOSC.IP_DROP_MEMBERSHIP,
Multicast_If => Constants.IP_MULTICAST_IF, Multicast_If => SOSC.IP_MULTICAST_IF,
Multicast_TTL => Constants.IP_MULTICAST_TTL, Multicast_TTL => SOSC.IP_MULTICAST_TTL,
Multicast_Loop => Constants.IP_MULTICAST_LOOP, Multicast_Loop => SOSC.IP_MULTICAST_LOOP,
Receive_Packet_Info => Constants.IP_PKTINFO, Receive_Packet_Info => SOSC.IP_PKTINFO,
Send_Timeout => Constants.SO_SNDTIMEO, Send_Timeout => SOSC.SO_SNDTIMEO,
Receive_Timeout => Constants.SO_RCVTIMEO); Receive_Timeout => SOSC.SO_RCVTIMEO);
-- ??? Note: for OpenSolaris, Receive_Packet_Info should be IP_RECVPKTINFO, -- ??? Note: for OpenSolaris, Receive_Packet_Info should be IP_RECVPKTINFO,
-- but for Linux compatibility this constant is the same as IP_PKTINFO. -- but for Linux compatibility this constant is the same as IP_PKTINFO.
Flags : constant array (0 .. 3) of C.int := Flags : constant array (0 .. 3) of C.int :=
(0 => Constants.MSG_OOB, -- Process_Out_Of_Band_Data (0 => SOSC.MSG_OOB, -- Process_Out_Of_Band_Data
1 => Constants.MSG_PEEK, -- Peek_At_Incoming_Data 1 => SOSC.MSG_PEEK, -- Peek_At_Incoming_Data
2 => Constants.MSG_WAITALL, -- Wait_For_A_Full_Reception 2 => SOSC.MSG_WAITALL, -- Wait_For_A_Full_Reception
3 => Constants.MSG_EOR); -- Send_End_Of_Record 3 => SOSC.MSG_EOR); -- Send_End_Of_Record
Socket_Error_Id : constant Exception_Id := Socket_Error'Identity; Socket_Error_Id : constant Exception_Id := Socket_Error'Identity;
Host_Error_Id : constant Exception_Id := Host_Error'Identity; Host_Error_Id : constant Exception_Id := Host_Error'Identity;
...@@ -138,7 +138,7 @@ package body GNAT.Sockets is ...@@ -138,7 +138,7 @@ package body GNAT.Sockets is
-- Return the int value corresponding to the specified flags combination -- Return the int value corresponding to the specified flags combination
function Set_Forced_Flags (F : C.int) return C.int; function Set_Forced_Flags (F : C.int) return C.int;
-- Return F with the bits from Constants.MSG_Forced_Flags forced set -- Return F with the bits from SOSC.MSG_Forced_Flags forced set
function Short_To_Network function Short_To_Network
(S : C.unsigned_short) return C.unsigned_short; (S : C.unsigned_short) return C.unsigned_short;
...@@ -882,7 +882,7 @@ package body GNAT.Sockets is ...@@ -882,7 +882,7 @@ package body GNAT.Sockets is
Err : aliased C.int; Err : aliased C.int;
begin begin
if Safe_Gethostbyaddr (HA'Address, HA'Size / 8, Constants.AF_INET, if Safe_Gethostbyaddr (HA'Address, HA'Size / 8, SOSC.AF_INET,
Res'Access, Buf'Address, Buflen, Err'Access) /= 0 Res'Access, Buf'Address, Buflen, Err'Access) /= 0
then then
Raise_Host_Error (Integer (Err)); Raise_Host_Error (Integer (Err));
...@@ -1260,7 +1260,7 @@ package body GNAT.Sockets is ...@@ -1260,7 +1260,7 @@ package body GNAT.Sockets is
-- calling Inet_Addr("") will not return an error. -- calling Inet_Addr("") will not return an error.
elsif Image = "" then elsif Image = "" then
Raise_Socket_Error (Constants.EINVAL); Raise_Socket_Error (SOSC.EINVAL);
end if; end if;
Img := New_String (Image); Img := New_String (Image);
...@@ -1268,7 +1268,7 @@ package body GNAT.Sockets is ...@@ -1268,7 +1268,7 @@ package body GNAT.Sockets is
Free (Img); Free (Img);
if Res = Failure then if Res = Failure then
Raise_Socket_Error (Constants.EINVAL); Raise_Socket_Error (SOSC.EINVAL);
end if; end if;
To_Inet_Addr (To_In_Addr (Res), Result); To_Inet_Addr (To_In_Addr (Res), Result);
...@@ -1280,7 +1280,7 @@ package body GNAT.Sockets is ...@@ -1280,7 +1280,7 @@ package body GNAT.Sockets is
---------------- ----------------
procedure Initialize (Process_Blocking_IO : Boolean) is procedure Initialize (Process_Blocking_IO : Boolean) is
Expected : constant Boolean := not Constants.Thread_Blocking_IO; Expected : constant Boolean := not SOSC.Thread_Blocking_IO;
begin begin
if Process_Blocking_IO /= Expected then if Process_Blocking_IO /= Expected then
raise Socket_Error with raise Socket_Error with
...@@ -1613,16 +1613,16 @@ package body GNAT.Sockets is ...@@ -1613,16 +1613,16 @@ package body GNAT.Sockets is
(Error_Value : Integer; (Error_Value : Integer;
From_Errno : Boolean := True) return Error_Type From_Errno : Boolean := True) return Error_Type
is is
use GNAT.Sockets.Constants; use GNAT.Sockets.SOSC;
begin begin
if not From_Errno then if not From_Errno then
case Error_Value is case Error_Value is
when Constants.HOST_NOT_FOUND => return Unknown_Host; when SOSC.HOST_NOT_FOUND => return Unknown_Host;
when Constants.TRY_AGAIN => return Host_Name_Lookup_Failure; when SOSC.TRY_AGAIN => return Host_Name_Lookup_Failure;
when Constants.NO_RECOVERY => return Non_Recoverable_Error; when SOSC.NO_RECOVERY => return Non_Recoverable_Error;
when Constants.NO_DATA => return Unknown_Server_Error; when SOSC.NO_DATA => return Unknown_Server_Error;
when others => return Cannot_Resolve_Error; when others => return Cannot_Resolve_Error;
end case; end case;
end if; end if;
...@@ -1828,8 +1828,8 @@ package body GNAT.Sockets is ...@@ -1828,8 +1828,8 @@ package body GNAT.Sockets is
pragma Warnings (Off); pragma Warnings (Off);
-- Following test may be compile time known on some targets -- Following test may be compile time known on some targets
if Vector'Length - Iov_Count > Constants.IOV_MAX then if Vector'Length - Iov_Count > SOSC.IOV_MAX then
This_Iov_Count := Constants.IOV_MAX; This_Iov_Count := SOSC.IOV_MAX;
else else
This_Iov_Count := Vector'Length - Iov_Count; This_Iov_Count := Vector'Length - Iov_Count;
end if; end if;
...@@ -1879,7 +1879,7 @@ package body GNAT.Sockets is ...@@ -1879,7 +1879,7 @@ package body GNAT.Sockets is
function To_int is function To_int is
new Ada.Unchecked_Conversion (C.unsigned, C.int); new Ada.Unchecked_Conversion (C.unsigned, C.int);
begin begin
return To_int (To_unsigned (F) or Constants.MSG_Forced_Flags); return To_int (To_unsigned (F) or SOSC.MSG_Forced_Flags);
end Set_Forced_Flags; end Set_Forced_Flags;
----------------------- -----------------------
...@@ -2160,7 +2160,7 @@ package body GNAT.Sockets is ...@@ -2160,7 +2160,7 @@ package body GNAT.Sockets is
if Current mod 2 /= 0 then if Current mod 2 /= 0 then
if Flags (J) = -1 then if Flags (J) = -1 then
Raise_Socket_Error (Constants.EOPNOTSUPP); Raise_Socket_Error (SOSC.EOPNOTSUPP);
end if; end if;
Result := Result + Flags (J); Result := Result + Flags (J);
......
...@@ -369,7 +369,7 @@ package GNAT.Sockets is ...@@ -369,7 +369,7 @@ package GNAT.Sockets is
-- Finalize; -- Finalize;
-- end PingPong; -- end PingPong;
package Constants renames System.OS_Constants; package SOSC renames System.OS_Constants;
-- Renaming used to provide short-hand notations thoughout the sockets -- Renaming used to provide short-hand notations thoughout the sockets
-- binding. Note that System.OS_Constants is an internal unit, and the -- binding. Note that System.OS_Constants is an internal unit, and the
-- entities declared therein are not meant for direct access by users, -- entities declared therein are not meant for direct access by users,
...@@ -414,10 +414,9 @@ package GNAT.Sockets is ...@@ -414,10 +414,9 @@ package GNAT.Sockets is
Immediate : constant Duration := 0.0; Immediate : constant Duration := 0.0;
Timeval_Forever : constant := Timeval_Forever : constant := 2.0 ** (SOSC.SIZEOF_tv_sec * 8 - 1) - 1.0;
2.0 ** (Constants.SIZEOF_tv_sec * 8 - 1) - 1.0; Forever : constant Duration :=
Forever : constant Duration := Duration'Min (Duration'Last, Timeval_Forever);
Duration'Min (Duration'Last, Timeval_Forever);
subtype Timeval_Duration is Duration range Immediate .. Forever; subtype Timeval_Duration is Duration range Immediate .. Forever;
......
...@@ -239,8 +239,8 @@ package body GNAT.Sockets.Thin is ...@@ -239,8 +239,8 @@ package body GNAT.Sockets.Thin is
Res := Standard_Connect (S, Name, Namelen); Res := Standard_Connect (S, Name, Namelen);
if Res = -1 then if Res = -1 then
if Socket_Errno = Constants.EWOULDBLOCK then if Socket_Errno = SOSC.EWOULDBLOCK then
Set_Socket_Errno (Constants.EINPROGRESS); Set_Socket_Errno (SOSC.EINPROGRESS);
end if; end if;
end if; end if;
...@@ -341,7 +341,7 @@ package body GNAT.Sockets.Thin is ...@@ -341,7 +341,7 @@ package body GNAT.Sockets.Thin is
if EFS /= No_Fd_Set_Access then if EFS /= No_Fd_Set_Access then
declare declare
EFSC : constant Fd_Set_Access := New_Socket_Set (EFS); EFSC : constant Fd_Set_Access := New_Socket_Set (EFS);
Flag : constant C.int := Constants.MSG_PEEK + Constants.MSG_OOB; Flag : constant C.int := SOSC.MSG_PEEK + Constants.MSG_OOB;
Buffer : Character; Buffer : Character;
Length : C.int; Length : C.int;
Fromlen : aliased C.int; Fromlen : aliased C.int;
...@@ -487,7 +487,7 @@ package body GNAT.Sockets.Thin is ...@@ -487,7 +487,7 @@ package body GNAT.Sockets.Thin is
function Socket_Error_Message function Socket_Error_Message
(Errno : Integer) return C.Strings.chars_ptr (Errno : Integer) return C.Strings.chars_ptr
is is
use GNAT.Sockets.Constants; use GNAT.Sockets.SOSC;
begin begin
case Errno is case Errno is
when EINTR => return Error_Messages (N_EINTR); when EINTR => return Error_Messages (N_EINTR);
......
...@@ -52,7 +52,7 @@ package body GNAT.Sockets.Thin is ...@@ -52,7 +52,7 @@ package body GNAT.Sockets.Thin is
-- been set in non-blocking mode by the user. -- been set in non-blocking mode by the user.
Quantum : constant Duration := 0.2; Quantum : constant Duration := 0.2;
-- When Constants.Thread_Blocking_IO is False, we set sockets in -- When SOSC.Thread_Blocking_IO is False, we set sockets in
-- non-blocking mode and we spend a period of time Quantum between -- non-blocking mode and we spend a period of time Quantum between
-- two attempts on a blocking operation. -- two attempts on a blocking operation.
...@@ -134,14 +134,14 @@ package body GNAT.Sockets.Thin is ...@@ -134,14 +134,14 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
R := Syscall_Accept (S, Addr, Addrlen); R := Syscall_Accept (S, Addr, Addrlen);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else R /= Failure or else R /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
if not Constants.Thread_Blocking_IO if not SOSC.Thread_Blocking_IO
and then R /= Failure and then R /= Failure
then then
-- A socket inherits the properties of its server, especially -- A socket inherits the properties of its server, especially
...@@ -149,7 +149,7 @@ package body GNAT.Sockets.Thin is ...@@ -149,7 +149,7 @@ package body GNAT.Sockets.Thin is
-- tracks sockets set in non-blocking mode by user. -- tracks sockets set in non-blocking mode by user.
Set_Non_Blocking_Socket (R, Non_Blocking_Socket (S)); Set_Non_Blocking_Socket (R, Non_Blocking_Socket (S));
Discard := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access); Discard := Syscall_Ioctl (R, SOSC.FIONBIO, Val'Unchecked_Access);
end if; end if;
return R; return R;
...@@ -169,10 +169,10 @@ package body GNAT.Sockets.Thin is ...@@ -169,10 +169,10 @@ package body GNAT.Sockets.Thin is
begin begin
Res := Syscall_Connect (S, Name, Namelen); Res := Syscall_Connect (S, Name, Namelen);
if Constants.Thread_Blocking_IO if SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EINPROGRESS or else Errno /= SOSC.EINPROGRESS
then then
return Res; return Res;
end if; end if;
...@@ -208,7 +208,7 @@ package body GNAT.Sockets.Thin is ...@@ -208,7 +208,7 @@ package body GNAT.Sockets.Thin is
Res := Syscall_Connect (S, Name, Namelen); Res := Syscall_Connect (S, Name, Namelen);
if Res = Failure and then Errno = Constants.EISCONN then if Res = Failure and then Errno = SOSC.EISCONN then
return Thin_Common.Success; return Thin_Common.Success;
else else
...@@ -226,8 +226,8 @@ package body GNAT.Sockets.Thin is ...@@ -226,8 +226,8 @@ package body GNAT.Sockets.Thin is
Arg : Int_Access) return C.int Arg : Int_Access) return C.int
is is
begin begin
if not Constants.Thread_Blocking_IO if not SOSC.Thread_Blocking_IO
and then Req = Constants.FIONBIO and then Req = SOSC.FIONBIO
then then
if Arg.all /= 0 then if Arg.all /= 0 then
Set_Non_Blocking_Socket (S, True); Set_Non_Blocking_Socket (S, True);
...@@ -252,10 +252,10 @@ package body GNAT.Sockets.Thin is ...@@ -252,10 +252,10 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
Res := Syscall_Recv (S, Msg, Len, Flags); Res := Syscall_Recv (S, Msg, Len, Flags);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
...@@ -279,10 +279,10 @@ package body GNAT.Sockets.Thin is ...@@ -279,10 +279,10 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
Res := Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen); Res := Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
...@@ -304,10 +304,10 @@ package body GNAT.Sockets.Thin is ...@@ -304,10 +304,10 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
Res := Syscall_Send (S, Msg, Len, Flags); Res := Syscall_Send (S, Msg, Len, Flags);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
...@@ -331,10 +331,10 @@ package body GNAT.Sockets.Thin is ...@@ -331,10 +331,10 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
Res := Syscall_Sendto (S, Msg, Len, Flags, To, Tolen); Res := Syscall_Sendto (S, Msg, Len, Flags, To, Tolen);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
...@@ -359,13 +359,13 @@ package body GNAT.Sockets.Thin is ...@@ -359,13 +359,13 @@ package body GNAT.Sockets.Thin is
begin begin
R := Syscall_Socket (Domain, Typ, Protocol); R := Syscall_Socket (Domain, Typ, Protocol);
if not Constants.Thread_Blocking_IO if not SOSC.Thread_Blocking_IO
and then R /= Failure and then R /= Failure
then then
-- Do not use C_Ioctl as this subprogram tracks sockets set -- Do not use C_Ioctl as this subprogram tracks sockets set
-- in non-blocking mode by user. -- in non-blocking mode by user.
Discard := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access); Discard := Syscall_Ioctl (R, SOSC.FIONBIO, Val'Unchecked_Access);
Set_Non_Blocking_Socket (R, False); Set_Non_Blocking_Socket (R, False);
end if; end if;
...@@ -508,7 +508,7 @@ package body GNAT.Sockets.Thin is ...@@ -508,7 +508,7 @@ package body GNAT.Sockets.Thin is
(Fd, (Fd,
Iovec (J).Base.all'Address, Iovec (J).Base.all'Address,
Interfaces.C.int (Iovec (J).Length), Interfaces.C.int (Iovec (J).Length),
Constants.MSG_Forced_Flags); SOSC.MSG_Forced_Flags);
if Res < 0 then if Res < 0 then
return Res; return Res;
......
...@@ -56,7 +56,7 @@ package body GNAT.Sockets.Thin is ...@@ -56,7 +56,7 @@ package body GNAT.Sockets.Thin is
-- been set in non-blocking mode by the user. -- been set in non-blocking mode by the user.
Quantum : constant Duration := 0.2; Quantum : constant Duration := 0.2;
-- When Constants.Thread_Blocking_IO is False, we set sockets in -- When SOSC.Thread_Blocking_IO is False, we set sockets in
-- non-blocking mode and we spend a period of time Quantum between -- non-blocking mode and we spend a period of time Quantum between
-- two attempts on a blocking operation. -- two attempts on a blocking operation.
...@@ -146,14 +146,14 @@ package body GNAT.Sockets.Thin is ...@@ -146,14 +146,14 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
R := Syscall_Accept (S, Addr, Addrlen); R := Syscall_Accept (S, Addr, Addrlen);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else R /= Failure or else R /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
if not Constants.Thread_Blocking_IO if not SOSC.Thread_Blocking_IO
and then R /= Failure and then R /= Failure
then then
-- A socket inherits the properties of its server especially -- A socket inherits the properties of its server especially
...@@ -161,7 +161,7 @@ package body GNAT.Sockets.Thin is ...@@ -161,7 +161,7 @@ package body GNAT.Sockets.Thin is
-- tracks sockets set in non-blocking mode by user. -- tracks sockets set in non-blocking mode by user.
Set_Non_Blocking_Socket (R, Non_Blocking_Socket (S)); Set_Non_Blocking_Socket (R, Non_Blocking_Socket (S));
Res := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access); Res := Syscall_Ioctl (R, SOSC.FIONBIO, Val'Unchecked_Access);
-- Is it OK to ignore result ??? -- Is it OK to ignore result ???
end if; end if;
...@@ -182,10 +182,10 @@ package body GNAT.Sockets.Thin is ...@@ -182,10 +182,10 @@ package body GNAT.Sockets.Thin is
begin begin
Res := Syscall_Connect (S, Name, Namelen); Res := Syscall_Connect (S, Name, Namelen);
if Constants.Thread_Blocking_IO if SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EINPROGRESS or else Errno /= SOSC.EINPROGRESS
then then
return Res; return Res;
end if; end if;
...@@ -223,7 +223,7 @@ package body GNAT.Sockets.Thin is ...@@ -223,7 +223,7 @@ package body GNAT.Sockets.Thin is
Res := Syscall_Connect (S, Name, Namelen); Res := Syscall_Connect (S, Name, Namelen);
if Res = Failure if Res = Failure
and then Errno = Constants.EISCONN and then Errno = SOSC.EISCONN
then then
return Thin_Common.Success; return Thin_Common.Success;
else else
...@@ -241,8 +241,8 @@ package body GNAT.Sockets.Thin is ...@@ -241,8 +241,8 @@ package body GNAT.Sockets.Thin is
Arg : Int_Access) return C.int Arg : Int_Access) return C.int
is is
begin begin
if not Constants.Thread_Blocking_IO if not SOSC.Thread_Blocking_IO
and then Req = Constants.FIONBIO and then Req = SOSC.FIONBIO
then then
if Arg.all /= 0 then if Arg.all /= 0 then
Set_Non_Blocking_Socket (S, True); Set_Non_Blocking_Socket (S, True);
...@@ -267,10 +267,10 @@ package body GNAT.Sockets.Thin is ...@@ -267,10 +267,10 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
Res := Syscall_Recv (S, Msg, Len, Flags); Res := Syscall_Recv (S, Msg, Len, Flags);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
...@@ -294,10 +294,10 @@ package body GNAT.Sockets.Thin is ...@@ -294,10 +294,10 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
Res := Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen); Res := Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
...@@ -319,10 +319,10 @@ package body GNAT.Sockets.Thin is ...@@ -319,10 +319,10 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
Res := Syscall_Send (S, Msg, Len, Flags); Res := Syscall_Send (S, Msg, Len, Flags);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
...@@ -346,10 +346,10 @@ package body GNAT.Sockets.Thin is ...@@ -346,10 +346,10 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
Res := Syscall_Sendto (S, Msg, Len, Flags, To, Tolen); Res := Syscall_Sendto (S, Msg, Len, Flags, To, Tolen);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
...@@ -374,13 +374,13 @@ package body GNAT.Sockets.Thin is ...@@ -374,13 +374,13 @@ package body GNAT.Sockets.Thin is
begin begin
R := Syscall_Socket (Domain, Typ, Protocol); R := Syscall_Socket (Domain, Typ, Protocol);
if not Constants.Thread_Blocking_IO if not SOSC.Thread_Blocking_IO
and then R /= Failure and then R /= Failure
then then
-- Do not use C_Ioctl as this subprogram tracks sockets set -- Do not use C_Ioctl as this subprogram tracks sockets set
-- in non-blocking mode by user. -- in non-blocking mode by user.
Res := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access); Res := Syscall_Ioctl (R, SOSC.FIONBIO, Val'Unchecked_Access);
-- Is it OK to ignore result ??? -- Is it OK to ignore result ???
Set_Non_Blocking_Socket (R, False); Set_Non_Blocking_Socket (R, False);
end if; end if;
......
...@@ -56,7 +56,7 @@ package body GNAT.Sockets.Thin is ...@@ -56,7 +56,7 @@ package body GNAT.Sockets.Thin is
-- been set in non-blocking mode by the user. -- been set in non-blocking mode by the user.
Quantum : constant Duration := 0.2; Quantum : constant Duration := 0.2;
-- When Constants.Thread_Blocking_IO is False, we set sockets in -- When SOSC.Thread_Blocking_IO is False, we set sockets in
-- non-blocking mode and we spend a period of time Quantum between -- non-blocking mode and we spend a period of time Quantum between
-- two attempts on a blocking operation. -- two attempts on a blocking operation.
...@@ -150,14 +150,14 @@ package body GNAT.Sockets.Thin is ...@@ -150,14 +150,14 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
R := Syscall_Accept (S, Addr, Addrlen); R := Syscall_Accept (S, Addr, Addrlen);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else R /= Failure or else R /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
if not Constants.Thread_Blocking_IO if not SOSC.Thread_Blocking_IO
and then R /= Failure and then R /= Failure
then then
-- A socket inherits the properties ot its server especially -- A socket inherits the properties ot its server especially
...@@ -165,7 +165,7 @@ package body GNAT.Sockets.Thin is ...@@ -165,7 +165,7 @@ package body GNAT.Sockets.Thin is
-- tracks sockets set in non-blocking mode by user. -- tracks sockets set in non-blocking mode by user.
Set_Non_Blocking_Socket (R, Non_Blocking_Socket (S)); Set_Non_Blocking_Socket (R, Non_Blocking_Socket (S));
Discard := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access); Discard := Syscall_Ioctl (R, SOSC.FIONBIO, Val'Unchecked_Access);
end if; end if;
Disable_SIGPIPE (R); Disable_SIGPIPE (R);
...@@ -186,10 +186,10 @@ package body GNAT.Sockets.Thin is ...@@ -186,10 +186,10 @@ package body GNAT.Sockets.Thin is
begin begin
Res := Syscall_Connect (S, Name, Namelen); Res := Syscall_Connect (S, Name, Namelen);
if Constants.Thread_Blocking_IO if SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EINPROGRESS or else Errno /= SOSC.EINPROGRESS
then then
return Res; return Res;
end if; end if;
...@@ -226,7 +226,7 @@ package body GNAT.Sockets.Thin is ...@@ -226,7 +226,7 @@ package body GNAT.Sockets.Thin is
Res := Syscall_Connect (S, Name, Namelen); Res := Syscall_Connect (S, Name, Namelen);
if Res = Failure if Res = Failure
and then Errno = Constants.EISCONN and then Errno = SOSC.EISCONN
then then
return Thin_Common.Success; return Thin_Common.Success;
else else
...@@ -244,8 +244,8 @@ package body GNAT.Sockets.Thin is ...@@ -244,8 +244,8 @@ package body GNAT.Sockets.Thin is
Arg : Int_Access) return C.int Arg : Int_Access) return C.int
is is
begin begin
if not Constants.Thread_Blocking_IO if not SOSC.Thread_Blocking_IO
and then Req = Constants.FIONBIO and then Req = SOSC.FIONBIO
then then
if Arg.all /= 0 then if Arg.all /= 0 then
Set_Non_Blocking_Socket (S, True); Set_Non_Blocking_Socket (S, True);
...@@ -270,10 +270,10 @@ package body GNAT.Sockets.Thin is ...@@ -270,10 +270,10 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
Res := Syscall_Recv (S, Msg, Len, Flags); Res := Syscall_Recv (S, Msg, Len, Flags);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
...@@ -297,10 +297,10 @@ package body GNAT.Sockets.Thin is ...@@ -297,10 +297,10 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
Res := Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen); Res := Syscall_Recvfrom (S, Msg, Len, Flags, From, Fromlen);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
...@@ -322,10 +322,10 @@ package body GNAT.Sockets.Thin is ...@@ -322,10 +322,10 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
Res := Syscall_Send (S, Msg, Len, Flags); Res := Syscall_Send (S, Msg, Len, Flags);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
...@@ -349,10 +349,10 @@ package body GNAT.Sockets.Thin is ...@@ -349,10 +349,10 @@ package body GNAT.Sockets.Thin is
begin begin
loop loop
Res := Syscall_Sendto (S, Msg, Len, Flags, To, Tolen); Res := Syscall_Sendto (S, Msg, Len, Flags, To, Tolen);
exit when Constants.Thread_Blocking_IO exit when SOSC.Thread_Blocking_IO
or else Res /= Failure or else Res /= Failure
or else Non_Blocking_Socket (S) or else Non_Blocking_Socket (S)
or else Errno /= Constants.EWOULDBLOCK; or else Errno /= SOSC.EWOULDBLOCK;
delay Quantum; delay Quantum;
end loop; end loop;
...@@ -377,13 +377,13 @@ package body GNAT.Sockets.Thin is ...@@ -377,13 +377,13 @@ package body GNAT.Sockets.Thin is
begin begin
R := Syscall_Socket (Domain, Typ, Protocol); R := Syscall_Socket (Domain, Typ, Protocol);
if not Constants.Thread_Blocking_IO if not SOSC.Thread_Blocking_IO
and then R /= Failure and then R /= Failure
then then
-- Do not use C_Ioctl as this subprogram tracks sockets set -- Do not use C_Ioctl as this subprogram tracks sockets set
-- in non-blocking mode by user. -- in non-blocking mode by user.
Discard := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access); Discard := Syscall_Ioctl (R, SOSC.FIONBIO, Val'Unchecked_Access);
Set_Non_Blocking_Socket (R, False); Set_Non_Blocking_Socket (R, False);
end if; end if;
Disable_SIGPIPE (R); Disable_SIGPIPE (R);
......
...@@ -54,7 +54,7 @@ package body GNAT.Sockets.Thin_Common is ...@@ -54,7 +54,7 @@ package body GNAT.Sockets.Thin_Common is
Family : Family_Type) Family : Family_Type)
is is
C_Family : C.int renames Families (Family); C_Family : C.int renames Families (Family);
Has_Sockaddr_Len : constant Boolean := Constants.Has_Sockaddr_Len /= 0; Has_Sockaddr_Len : constant Boolean := SOSC.Has_Sockaddr_Len /= 0;
begin begin
if Has_Sockaddr_Len then if Has_Sockaddr_Len then
Length_And_Family.Length := Lengths (Family); Length_And_Family.Length := Lengths (Family);
......
...@@ -51,15 +51,15 @@ package GNAT.Sockets.Thin_Common is ...@@ -51,15 +51,15 @@ package GNAT.Sockets.Thin_Common is
Failure : constant C.int := -1; Failure : constant C.int := -1;
type time_t is type time_t is
range -2 ** (8 * Constants.SIZEOF_tv_sec - 1) range -2 ** (8 * SOSC.SIZEOF_tv_sec - 1)
.. 2 ** (8 * Constants.SIZEOF_tv_sec - 1) - 1; .. 2 ** (8 * SOSC.SIZEOF_tv_sec - 1) - 1;
for time_t'Size use 8 * Constants.SIZEOF_tv_sec; for time_t'Size use 8 * SOSC.SIZEOF_tv_sec;
pragma Convention (C, time_t); pragma Convention (C, time_t);
type suseconds_t is type suseconds_t is
range -2 ** (8 * Constants.SIZEOF_tv_usec - 1) range -2 ** (8 * SOSC.SIZEOF_tv_usec - 1)
.. 2 ** (8 * Constants.SIZEOF_tv_usec - 1) - 1; .. 2 ** (8 * SOSC.SIZEOF_tv_usec - 1) - 1;
for suseconds_t'Size use 8 * Constants.SIZEOF_tv_usec; for suseconds_t'Size use 8 * SOSC.SIZEOF_tv_usec;
pragma Convention (C, suseconds_t); pragma Convention (C, suseconds_t);
type Timeval is record type Timeval is record
...@@ -78,12 +78,12 @@ package GNAT.Sockets.Thin_Common is ...@@ -78,12 +78,12 @@ package GNAT.Sockets.Thin_Common is
------------------------------------------- -------------------------------------------
Families : constant array (Family_Type) of C.int := Families : constant array (Family_Type) of C.int :=
(Family_Inet => Constants.AF_INET, (Family_Inet => SOSC.AF_INET,
Family_Inet6 => Constants.AF_INET6); Family_Inet6 => SOSC.AF_INET6);
Lengths : constant array (Family_Type) of C.unsigned_char := Lengths : constant array (Family_Type) of C.unsigned_char :=
(Family_Inet => Constants.SIZEOF_sockaddr_in, (Family_Inet => SOSC.SIZEOF_sockaddr_in,
Family_Inet6 => Constants.SIZEOF_sockaddr_in6); Family_Inet6 => SOSC.SIZEOF_sockaddr_in6);
---------------------------- ----------------------------
-- Generic socket address -- -- Generic socket address --
...@@ -95,7 +95,7 @@ package GNAT.Sockets.Thin_Common is ...@@ -95,7 +95,7 @@ package GNAT.Sockets.Thin_Common is
-- and protocol specific address types) start with the same 2-byte header, -- and protocol specific address types) start with the same 2-byte header,
-- which is either a length and a family (one byte each) or just a two-byte -- which is either a length and a family (one byte each) or just a two-byte
-- family. The following unchecked union describes the two possible layouts -- family. The following unchecked union describes the two possible layouts
-- and is meant to be constrained with Constants.Have_Sockaddr_Len. -- and is meant to be constrained with SOSC.Have_Sockaddr_Len.
type Sockaddr_Length_And_Family type Sockaddr_Length_And_Family
(Has_Sockaddr_Len : Boolean := False) (Has_Sockaddr_Len : Boolean := False)
...@@ -231,8 +231,8 @@ package GNAT.Sockets.Thin_Common is ...@@ -231,8 +231,8 @@ package GNAT.Sockets.Thin_Common is
type Hostent is record type Hostent is record
H_Name : C.Strings.chars_ptr; H_Name : C.Strings.chars_ptr;
H_Aliases : Chars_Ptr_Pointers.Pointer; H_Aliases : Chars_Ptr_Pointers.Pointer;
H_Addrtype : Constants.H_Addrtype_T; H_Addrtype : SOSC.H_Addrtype_T;
H_Length : Constants.H_Length_T; H_Length : SOSC.H_Length_T;
H_Addr_List : In_Addr_Access_Pointers.Pointer; H_Addr_List : In_Addr_Access_Pointers.Pointer;
end record; end record;
pragma Convention (C, Hostent); pragma Convention (C, Hostent);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
-- -- -- --
-- B o d y -- -- B o d y --
-- -- -- --
-- Copyright (C) 2007, AdaCore -- -- Copyright (C) 2007-2008, AdaCore --
-- -- -- --
-- GNAT is free software; you can redistribute it and/or modify it under -- -- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- -- -- terms of the GNU General Public License as published by the Free Soft- --
...@@ -54,16 +54,16 @@ package body Host_Error_Messages is ...@@ -54,16 +54,16 @@ package body Host_Error_Messages is
renames To_Chars_Ptr; renames To_Chars_Ptr;
begin begin
case H_Errno is case H_Errno is
when Constants.HOST_NOT_FOUND => when SOSC.HOST_NOT_FOUND =>
return TCP (Messages.HOST_NOT_FOUND'Access); return TCP (Messages.HOST_NOT_FOUND'Access);
when Constants.TRY_AGAIN => when SOSC.TRY_AGAIN =>
return TCP (Messages.TRY_AGAIN'Access); return TCP (Messages.TRY_AGAIN'Access);
when Constants.NO_RECOVERY => when SOSC.NO_RECOVERY =>
return TCP (Messages.NO_RECOVERY'Access); return TCP (Messages.NO_RECOVERY'Access);
when Constants.NO_DATA => when SOSC.NO_DATA =>
return TCP (Messages.NO_DATA'Access); return TCP (Messages.NO_DATA'Access);
when others => when others =>
......
...@@ -82,7 +82,7 @@ package body Signalling_Fds is ...@@ -82,7 +82,7 @@ package body Signalling_Fds is
-- Create a listening socket -- Create a listening socket
L_Sock := C_Socket (Constants.AF_INET, Constants.SOCK_STREAM, 0); L_Sock := C_Socket (SOSC.AF_INET, Constants.SOCK_STREAM, 0);
if L_Sock = Failure then if L_Sock = Failure then
goto Fail; goto Fail;
...@@ -122,7 +122,7 @@ package body Signalling_Fds is ...@@ -122,7 +122,7 @@ package body Signalling_Fds is
-- Create read end (client) socket -- Create read end (client) socket
R_Sock := C_Socket (Constants.AF_INET, Constants.SOCK_STREAM, 0); R_Sock := C_Socket (SOSC.AF_INET, Constants.SOCK_STREAM, 0);
if R_Sock = Failure then if R_Sock = Failure then
goto Fail; goto Fail;
...@@ -134,7 +134,7 @@ package body Signalling_Fds is ...@@ -134,7 +134,7 @@ package body Signalling_Fds is
exit when Res /= Failure; exit when Res /= Failure;
if Socket_Errno /= Constants.EADDRINUSE then if Socket_Errno /= SOSC.EADDRINUSE then
goto Fail; goto Fail;
end if; end if;
...@@ -152,7 +152,7 @@ package body Signalling_Fds is ...@@ -152,7 +152,7 @@ package body Signalling_Fds is
pragma Assert (Res = Failure pragma Assert (Res = Failure
and then and then
Socket_Errno = Constants.EADDRINUSE); Socket_Errno = SOSC.EADDRINUSE);
pragma Warnings (Off); -- useless assignment to "Res" pragma Warnings (Off); -- useless assignment to "Res"
Res := C_Close (W_Sock); Res := C_Close (W_Sock);
pragma Warnings (On); pragma Warnings (On);
...@@ -217,7 +217,7 @@ package body Signalling_Fds is ...@@ -217,7 +217,7 @@ package body Signalling_Fds is
function Read (Rsig : C.int) return C.int is function Read (Rsig : C.int) return C.int is
Buf : aliased Character; Buf : aliased Character;
begin begin
return C_Recv (Rsig, Buf'Address, 1, Constants.MSG_Forced_Flags); return C_Recv (Rsig, Buf'Address, 1, SOSC.MSG_Forced_Flags);
end Read; end Read;
----------- -----------
...@@ -227,7 +227,7 @@ package body Signalling_Fds is ...@@ -227,7 +227,7 @@ package body Signalling_Fds is
function Write (Wsig : C.int) return C.int is function Write (Wsig : C.int) return C.int is
Buf : aliased Character := ASCII.NUL; Buf : aliased Character := ASCII.NUL;
begin begin
return C_Send (Wsig, Buf'Address, 1, Constants.MSG_Forced_Flags); return C_Send (Wsig, Buf'Address, 1, SOSC.MSG_Forced_Flags);
end Write; end Write;
end Signalling_Fds; end Signalling_Fds;
...@@ -81,7 +81,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is ...@@ -81,7 +81,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
-- VxWorks does not provide h_errno -- VxWorks does not provide h_errno
begin begin
pragma Assert (Addr_Type = Constants.AF_INET); pragma Assert (Addr_Type = SOSC.AF_INET);
pragma Assert (Addr_Len = In_Addr'Size / 8); pragma Assert (Addr_Len = In_Addr'Size / 8);
-- Check that provided buffer is sufficiently large to hold the -- Check that provided buffer is sufficiently large to hold the
...@@ -93,7 +93,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is ...@@ -93,7 +93,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
if VxWorks_hostGetByAddr (To_Pointer (Addr).all, if VxWorks_hostGetByAddr (To_Pointer (Addr).all,
Netdb_Data.Name'Address) Netdb_Data.Name'Address)
/= Constants.OK /= SOSC.OK
then then
return -1; return -1;
end if; end if;
...@@ -106,7 +106,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is ...@@ -106,7 +106,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
Ret.H_Name := C.Strings.To_Chars_Ptr Ret.H_Name := C.Strings.To_Chars_Ptr
(Netdb_Data.Name'Unrestricted_Access); (Netdb_Data.Name'Unrestricted_Access);
Ret.H_Aliases := Alias_Access; Ret.H_Aliases := Alias_Access;
Ret.H_Addrtype := Constants.AF_INET; Ret.H_Addrtype := SOSC.AF_INET;
Ret.H_Length := 4; Ret.H_Length := 4;
Ret.H_Addr_List := Ret.H_Addr_List :=
Netdb_Data.Addr_List (Netdb_Data.Addr_List'First)'Unchecked_Access; Netdb_Data.Addr_List (Netdb_Data.Addr_List'First)'Unchecked_Access;
...@@ -135,7 +135,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is ...@@ -135,7 +135,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
begin begin
Addr := VxWorks_hostGetByName (Name); Addr := VxWorks_hostGetByName (Name);
if Addr = Constants.ERROR then if Addr = SOSC.ERROR then
return -1; return -1;
end if; end if;
...@@ -161,7 +161,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is ...@@ -161,7 +161,7 @@ package body GNAT.Sockets.Thin.Task_Safe_NetDB is
Ret.H_Name := C.Strings.To_Chars_Ptr Ret.H_Name := C.Strings.To_Chars_Ptr
(Netdb_Data.Name'Unrestricted_Access); (Netdb_Data.Name'Unrestricted_Access);
Ret.H_Aliases := Alias_Access; Ret.H_Aliases := Alias_Access;
Ret.H_Addrtype := Constants.AF_INET; Ret.H_Addrtype := SOSC.AF_INET;
Ret.H_Length := 4; Ret.H_Length := 4;
Ret.H_Addr_List := Ret.H_Addr_List :=
Netdb_Data.Addr_List (Netdb_Data.Addr_List'First)'Unchecked_Access; Netdb_Data.Addr_List (Netdb_Data.Addr_List'First)'Unchecked_Access;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment