diff options
author | Thomas Quinot <quinot@act-europe.fr> | 2004-10-04 16:49:35 +0200 |
---|---|---|
committer | Arnaud Charlet <charlet@gcc.gnu.org> | 2004-10-04 16:49:35 +0200 |
commit | d6c7ed5017ae925f18acde16f02f9a0ed2f1b960 (patch) | |
tree | 7d917cde2a4fa0a26ee9117ad99650660d705a3f /gcc/ada/g-socthi.adb | |
parent | fded8de7d64cf357aaeb7ccb51b6e850d9557e4a (diff) | |
download | gcc-d6c7ed5017ae925f18acde16f02f9a0ed2f1b960.tar.gz |
g-socket.ads, [...]: Add new sockets constant MSG_NOSIGNAL (Linux-specific).
2004-10-04 Thomas Quinot <quinot@act-europe.fr>
* g-socket.ads, g-socket.adb, g-socthi.adb, socket.c,
g-soccon-aix.ads, g-soccon-irix.ads, g-soccon-hpux.ads,
g-soccon-interix.ads, g-soccon-solaris.ads, g-soccon-vms.adb,
g-soccon-mingw.ads, g-soccon-vxworks.ads, g-soccon-freebsd.ads,
g-soccon.ads, g-soccon-unixware.ads, g-soccon-tru64.ads: Add new
sockets constant MSG_NOSIGNAL (Linux-specific).
Add new sockets constant MSG_Forced_Flags, list of flags to be set on
all Send operations.
For Linux, set MSG_NOSIGNAL on all send operations to prevent them
from trigerring SIGPIPE.
Rename components to avoid clash with Ada 2005 possible reserved
word 'interface'.
(Check_Selector): When the select system call returns with an error
condition, propagate Socket_Error to the caller.
From-SVN: r88485
Diffstat (limited to 'gcc/ada/g-socthi.adb')
-rw-r--r-- | gcc/ada/g-socthi.adb | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/ada/g-socthi.adb b/gcc/ada/g-socthi.adb index 9600cda6428..26c5e627491 100644 --- a/gcc/ada/g-socthi.adb +++ b/gcc/ada/g-socthi.adb @@ -61,10 +61,13 @@ package body GNAT.Sockets.Thin is -- two attempts on a blocking operation. Thread_Blocking_IO : Boolean := True; + -- Comment required for this ??? Unknown_System_Error : constant C.Strings.chars_ptr := C.Strings.New_String ("Unknown system error"); + -- Comments required for following functions ??? + function Syscall_Accept (S : C.int; Addr : System.Address; @@ -121,6 +124,9 @@ package body GNAT.Sockets.Thin is Protocol : C.int) return C.int; pragma Import (C, Syscall_Socket, "socket"); + procedure Disable_SIGPIPE (S : C.int); + pragma Import (C, Disable_SIGPIPE, "__gnat_disable_sigpipe"); + function Non_Blocking_Socket (S : C.int) return Boolean; procedure Set_Non_Blocking_Socket (S : C.int; V : Boolean); @@ -160,6 +166,7 @@ package body GNAT.Sockets.Thin is Discard := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access); end if; + Disable_SIGPIPE (R); return R; end C_Accept; @@ -377,7 +384,7 @@ package body GNAT.Sockets.Thin is Discard := Syscall_Ioctl (R, Constants.FIONBIO, Val'Unchecked_Access); Set_Non_Blocking_Socket (R, False); end if; - + Disable_SIGPIPE (R); return R; end C_Socket; |