summaryrefslogtreecommitdiff
path: root/sysdeps/mach/hurd/send.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-06-14 17:09:59 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-06-14 17:11:22 +0000
commit0c46891442c0b4ca593691f62ad1213e022ff00b (patch)
tree1e17d559dbb26fff30ea05b3166ec8463abac587 /sysdeps/mach/hurd/send.c
parent45fce058fe7c9a14800a10564a7bc1970f4c7c49 (diff)
downloadglibc-0c46891442c0b4ca593691f62ad1213e022ff00b.tar.gz
hurd: Make send* cancellation points
* sysdeps/mach/hurd/send.c (__send): Make the __socket_send call a cancellation point. * sysdeps/mach/hurd/sendto.c (__sendto): Likewise. * sysdeps/mach/hurd/sendmsg.c (__libc_sendmsg): Likewise.
Diffstat (limited to 'sysdeps/mach/hurd/send.c')
-rw-r--r--sysdeps/mach/hurd/send.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sysdeps/mach/hurd/send.c b/sysdeps/mach/hurd/send.c
index af002765d2..78edbc2ff3 100644
--- a/sysdeps/mach/hurd/send.c
+++ b/sysdeps/mach/hurd/send.c
@@ -20,6 +20,7 @@
#include <hurd.h>
#include <hurd/socket.h>
#include <hurd/fd.h>
+#include <sysdep-cancel.h>
/* Send N bytes of BUF to socket FD. Returns the number sent or -1. */
ssize_t
@@ -27,11 +28,14 @@ __send (int fd, const void *buf, size_t n, int flags)
{
error_t err;
size_t wrote;
+ int cancel_oldtype;
+ cancel_oldtype = LIBC_CANCEL_ASYNC();
err = HURD_DPORT_USE (fd, __socket_send (port, MACH_PORT_NULL,
flags, buf, n,
NULL, MACH_MSG_TYPE_COPY_SEND, 0,
NULL, 0, &wrote));
+ LIBC_CANCEL_RESET (cancel_oldtype);
if (err == MIG_BAD_ID || err == EOPNOTSUPP)
/* The file did not grok the socket protocol. */