aboutsummaryrefslogtreecommitdiff
path: root/hurd
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2008-07-02 09:53:29 +0000
committerRoland McGrath <roland@gnu.org>2008-07-02 09:53:29 +0000
commite66ecb226ed6991d0c39a0daf7730e65fe555c6c (patch)
treeca2f000a788dc0c929ffd79917fbd39fa56406f3 /hurd
parentcc9f65ce82d4995e776464a1656587c39f6b14bb (diff)
downloadglibc-e66ecb226ed6991d0c39a0daf7730e65fe555c6c.zip
glibc-e66ecb226ed6991d0c39a0daf7730e65fe555c6c.tar.gz
glibc-e66ecb226ed6991d0c39a0daf7730e65fe555c6c.tar.bz2
2008-07-01 Samuel Thibault <samuel.thibault@ens-lyon.org>
* sysdeps/unix/bsd/bsd4.4/bits/socket.h: Define MSG_NOSIGNAL. * hurd/hurd/fd.h (__hurd_sockfail): Add extern inline function. * sysdeps/mach/hurd/recv.c (__recv): Use __hurd_sockfail instead of __hurd_dfail. * sysdeps/mach/hurd/recvfrom.c (__recvfrom): Likewise * sysdeps/mach/hurd/recvmsg.c (__recvmsg): Likewise * sysdeps/mach/hurd/send.c (__send): Likewise * sysdeps/mach/hurd/sendfrom.c (__sendfrom): Likewise * sysdeps/mach/hurd/sendmsg.c (__sendmsg): Likewise
Diffstat (limited to 'hurd')
-rw-r--r--hurd/hurd/fd.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/hurd/hurd/fd.h b/hurd/hurd/fd.h
index 08d4407..d1aa867 100644
--- a/hurd/hurd/fd.h
+++ b/hurd/hurd/fd.h
@@ -27,6 +27,7 @@
#include <hurd/hurd_types.h>
#include <hurd/port.h>
+#include <sys/socket.h>
/* Structure representing a file descriptor. */
@@ -179,6 +180,18 @@ __hurd_dfail (int fd, error_t err)
errno = _hurd_fd_error (fd, err);
return -1;
}
+
+/* Likewise, but do not raise SIGPIPE on EPIPE if flags contain
+ MSG_NOSIGNAL. */
+
+_HURD_FD_H_EXTERN_INLINE int
+__hurd_sockfail (int fd, int flags, error_t err)
+{
+ if (!(flags & MSG_NOSIGNAL) || err != EPIPE)
+ err = _hurd_fd_error (fd, err);
+ errno = err;
+ return -1;
+}
/* Set up *FD to have PORT its server port, doing appropriate ctty magic.
Does no locking or unlocking. */