summaryrefslogtreecommitdiff
path: root/gcc/ada/socket.c
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-04 14:49:35 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2004-10-04 14:49:35 +0000
commit0a9123763bce222e18ee608a635106e501c4d0ce (patch)
tree7d917cde2a4fa0a26ee9117ad99650660d705a3f /gcc/ada/socket.c
parent03ec6c0e80286b90c7f83f1ecf22aeb2b4bfa80b (diff)
downloadgcc-0a9123763bce222e18ee608a635106e501c4d0ce.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@88485 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/socket.c')
-rw-r--r--gcc/ada/socket.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
index 89b8163fada..6f5067fcabe 100644
--- a/gcc/ada/socket.c
+++ b/gcc/ada/socket.c
@@ -64,8 +64,13 @@
#include "system.h"
#endif
+#if !(defined (VMS) || defined (__MINGW32__))
+# include <sys/socket.h>
+#endif
+
#include "raise.h"
+extern void __gnat_disable_sigpipe (int fd);
extern void __gnat_free_socket_set (fd_set *);
extern void __gnat_last_socket_in_set (fd_set *, int *);
extern void __gnat_get_socket_from_set (fd_set *, int *, int *);
@@ -74,6 +79,16 @@ extern int __gnat_is_socket_in_set (fd_set *, int);
extern fd_set *__gnat_new_socket_set (fd_set *);
extern void __gnat_remove_socket_from_set (fd_set *, int);
+/* Disable the sending of SIGPIPE for writes on a broken stream */
+void
+__gnat_disable_sigpipe (int fd)
+{
+#ifdef SO_NOSIGPIPE
+ int val = 1;
+ (void) setsockopt (fd, SOL_SOCKET, SO_NOSIGPIPE, &val, sizeof val);
+#endif
+}
+
/* Free socket set. */
void