diff options
Diffstat (limited to 'gcc/ada/g-socthi.adb')
-rw-r--r-- | gcc/ada/g-socthi.adb | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/gcc/ada/g-socthi.adb b/gcc/ada/g-socthi.adb index 19642aa893d..57b76bc2fe0 100644 --- a/gcc/ada/g-socthi.adb +++ b/gcc/ada/g-socthi.adb @@ -38,7 +38,6 @@ -- This is the default version with GNAT.OS_Lib; use GNAT.OS_Lib; -with GNAT.Sockets.Constants; with GNAT.Task_Lock; with Interfaces.C; use Interfaces.C; @@ -57,7 +56,7 @@ package body GNAT.Sockets.Thin is -- been set in non-blocking mode by the user. 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 -- two attempts on a blocking operation. @@ -151,14 +150,14 @@ package body GNAT.Sockets.Thin is begin loop R := Syscall_Accept (S, Addr, Addrlen); - exit when Constants.Thread_Blocking_IO + exit when SOSC.Thread_Blocking_IO or else R /= Failure or else Non_Blocking_Socket (S) - or else Errno /= Constants.EWOULDBLOCK; + or else Errno /= SOSC.EWOULDBLOCK; delay Quantum; end loop; - if not Constants.Thread_Blocking_IO + if not SOSC.Thread_Blocking_IO and then R /= Failure then -- A socket inherits the properties ot its server especially @@ -166,7 +165,7 @@ package body GNAT.Sockets.Thin is -- tracks sockets set in non-blocking mode by user. 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; Disable_SIGPIPE (R); @@ -187,10 +186,10 @@ package body GNAT.Sockets.Thin is begin Res := Syscall_Connect (S, Name, Namelen); - if Constants.Thread_Blocking_IO + if SOSC.Thread_Blocking_IO or else Res /= Failure or else Non_Blocking_Socket (S) - or else Errno /= Constants.EINPROGRESS + or else Errno /= SOSC.EINPROGRESS then return Res; end if; @@ -227,7 +226,7 @@ package body GNAT.Sockets.Thin is Res := Syscall_Connect (S, Name, Namelen); if Res = Failure - and then Errno = Constants.EISCONN + and then Errno = SOSC.EISCONN then return Thin_Common.Success; else @@ -245,8 +244,8 @@ package body GNAT.Sockets.Thin is Arg : Int_Access) return C.int is begin - if not Constants.Thread_Blocking_IO - and then Req = Constants.FIONBIO + if not SOSC.Thread_Blocking_IO + and then Req = SOSC.FIONBIO then if Arg.all /= 0 then Set_Non_Blocking_Socket (S, True); @@ -271,10 +270,10 @@ package body GNAT.Sockets.Thin is begin loop 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 Non_Blocking_Socket (S) - or else Errno /= Constants.EWOULDBLOCK; + or else Errno /= SOSC.EWOULDBLOCK; delay Quantum; end loop; @@ -298,10 +297,10 @@ package body GNAT.Sockets.Thin is begin loop 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 Non_Blocking_Socket (S) - or else Errno /= Constants.EWOULDBLOCK; + or else Errno /= SOSC.EWOULDBLOCK; delay Quantum; end loop; @@ -323,10 +322,10 @@ package body GNAT.Sockets.Thin is begin loop 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 Non_Blocking_Socket (S) - or else Errno /= Constants.EWOULDBLOCK; + or else Errno /= SOSC.EWOULDBLOCK; delay Quantum; end loop; @@ -350,10 +349,10 @@ package body GNAT.Sockets.Thin is begin loop 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 Non_Blocking_Socket (S) - or else Errno /= Constants.EWOULDBLOCK; + or else Errno /= SOSC.EWOULDBLOCK; delay Quantum; end loop; @@ -378,13 +377,13 @@ package body GNAT.Sockets.Thin is begin R := Syscall_Socket (Domain, Typ, Protocol); - if not Constants.Thread_Blocking_IO + if not SOSC.Thread_Blocking_IO and then R /= Failure then -- Do not use C_Ioctl as this subprogram tracks sockets set -- 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); end if; Disable_SIGPIPE (R); |