diff options
Diffstat (limited to 'gcc')
| -rw-r--r-- | gcc/ada/g-socket.adb | 18 | ||||
| -rw-r--r-- | gcc/ada/g-socthi-mingw.adb | 2 | ||||
| -rw-r--r-- | gcc/ada/g-socthi-vms.adb | 10 | ||||
| -rw-r--r-- | gcc/ada/g-socthi-vxworks.ads | 14 | ||||
| -rw-r--r-- | gcc/ada/g-socthi.ads | 12 |
5 files changed, 20 insertions, 36 deletions
diff --git a/gcc/ada/g-socket.adb b/gcc/ada/g-socket.adb index 01f9d19..ab2ed6e 100644 --- a/gcc/ada/g-socket.adb +++ b/gcc/ada/g-socket.adb @@ -226,14 +226,17 @@ package body GNAT.Sockets is -------------------- procedure Abort_Selector (Selector : Selector_Type) is - Buf : aliased Character := ASCII.NUL; - Discard : C.int; - pragma Unreferenced (Discard); + Buf : aliased Character := ASCII.NUL; + Res : C.int; begin -- Send an empty array to unblock C select system call - Discard := C_Write (C.int (Selector.W_Sig_Socket), Buf'Address, 1); + Res := C_Send (C.int (Selector.W_Sig_Socket), Buf'Address, 1, + Constants.MSG_Forced_Flags); + if Res = Failure then + Raise_Socket_Error (Socket_Errno); + end if; end Abort_Selector; ------------------- @@ -440,8 +443,13 @@ package body GNAT.Sockets is declare Buf : Character; + begin - Res := C_Read (C.int (Selector.R_Sig_Socket), Buf'Address, 1); + Res := C_Recv (C.int (Selector.R_Sig_Socket), Buf'Address, 1, 0); + + if Res = Failure then + Raise_Socket_Error (Socket_Errno); + end if; end; Status := Aborted; diff --git a/gcc/ada/g-socthi-mingw.adb b/gcc/ada/g-socthi-mingw.adb index 214e0f3..57efefe 100644 --- a/gcc/ada/g-socthi-mingw.adb +++ b/gcc/ada/g-socthi-mingw.adb @@ -318,7 +318,7 @@ package body GNAT.Sockets.Thin is -- POSIX compatitibility, copy write fd set into exception fd -- set. Once select() returns, check any socket present in the -- exception fd set and peek at incoming out-of-band data. If - -- the test is not successfull and if the socket is present in + -- the test is not successful, and the socket is present in -- the initial write fd set, then move the socket from the -- exception fd set to the write fd set. diff --git a/gcc/ada/g-socthi-vms.adb b/gcc/ada/g-socthi-vms.adb index 4d4a911..94968b5 100644 --- a/gcc/ada/g-socthi-vms.adb +++ b/gcc/ada/g-socthi-vms.adb @@ -502,10 +502,11 @@ package body GNAT.Sockets.Thin is begin for J in Iovec'Range loop - Res := C_Read + Res := C_Recv (Fd, Iovec (J).Base.all'Address, - Interfaces.C.int (Iovec (J).Length)); + Interfaces.C.int (Iovec (J).Length), + 0); if Res < 0 then return Res; @@ -534,10 +535,11 @@ package body GNAT.Sockets.Thin is begin for J in Iovec'Range loop - Res := C_Write + Res := C_Send (Fd, Iovec (J).Base.all'Address, - Interfaces.C.int (Iovec (J).Length)); + Interfaces.C.int (Iovec (J).Length), + Constants.MSG_Forced_Flags); if Res < 0 then return Res; diff --git a/gcc/ada/g-socthi-vxworks.ads b/gcc/ada/g-socthi-vxworks.ads index f389e9a..cfc519d 100644 --- a/gcc/ada/g-socthi-vxworks.ads +++ b/gcc/ada/g-socthi-vxworks.ads @@ -275,12 +275,6 @@ package GNAT.Sockets.Thin is function C_Listen (S, Backlog : C.int) return C.int; - function C_Read - (Fd : C.int; - Buf : System.Address; - Count : C.int) - return C.int; - function C_Readv (Fd : C.int; Iov : System.Address; @@ -354,12 +348,6 @@ package GNAT.Sockets.Thin is (Command : System.Address) return C.int; - function C_Write - (Fd : C.int; - Buf : System.Address; - Count : C.int) - return C.int; - function C_Writev (Fd : C.int; Iov : System.Address; @@ -425,14 +413,12 @@ private pragma Import (C, C_Getsockopt, "getsockopt"); pragma Import (C, C_Inet_Addr, "inet_addr"); pragma Import (C, C_Listen, "listen"); - pragma Import (C, C_Read, "read"); pragma Import (C, C_Readv, "readv"); pragma Import (C, C_Select, "select"); pragma Import (C, C_Setsockopt, "setsockopt"); pragma Import (C, C_Shutdown, "shutdown"); pragma Import (C, C_Strerror, "strerror"); pragma Import (C, C_System, "system"); - pragma Import (C, C_Write, "write"); pragma Import (C, C_Writev, "writev"); pragma Import (C, Free_Socket_Set, "__gnat_free_socket_set"); diff --git a/gcc/ada/g-socthi.ads b/gcc/ada/g-socthi.ads index 7a818d8..8491853 100644 --- a/gcc/ada/g-socthi.ads +++ b/gcc/ada/g-socthi.ads @@ -262,11 +262,6 @@ package GNAT.Sockets.Thin is (S : C.int; Backlog : C.int) return C.int; - function C_Read - (Fd : C.int; - Buf : System.Address; - Count : C.int) return C.int; - function C_Readv (Fd : C.int; Iov : System.Address; @@ -329,11 +324,6 @@ package GNAT.Sockets.Thin is function C_System (Command : System.Address) return C.int; - function C_Write - (Fd : C.int; - Buf : System.Address; - Count : C.int) return C.int; - function C_Writev (Fd : C.int; Iov : System.Address; @@ -400,14 +390,12 @@ private pragma Import (C, C_Getsockopt, "getsockopt"); pragma Import (C, C_Inet_Addr, "inet_addr"); pragma Import (C, C_Listen, "listen"); - pragma Import (C, C_Read, "read"); pragma Import (C, C_Readv, "readv"); pragma Import (C, C_Select, "select"); pragma Import (C, C_Setsockopt, "setsockopt"); pragma Import (C, C_Shutdown, "shutdown"); pragma Import (C, C_Strerror, "strerror"); pragma Import (C, C_System, "system"); - pragma Import (C, C_Write, "write"); pragma Import (C, C_Writev, "writev"); pragma Import (C, Free_Socket_Set, "__gnat_free_socket_set"); |
