about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/writev_nocancel_nostatus.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-06-14 17:44:57 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-06-14 17:45:04 +0000
commitc1dcc541131bb090ddc792139545ffcd2511a1dc (patch)
treef062f6c64a1acf12c1ddda32bbd197083c424c0d /sysdeps/mach/hurd/writev_nocancel_nostatus.c
parent0c46891442c0b4ca593691f62ad1213e022ff00b (diff)
downloadglibc-c1dcc541131bb090ddc792139545ffcd2511a1dc.tar.gz
glibc-c1dcc541131bb090ddc792139545ffcd2511a1dc.tar.xz
glibc-c1dcc541131bb090ddc792139545ffcd2511a1dc.zip
hurd: Fix __writev_nocancel_nostatus
* sysdeps/mach/hurd/Makefile [subdir=misc] (sysdep_routines): Add
writev_nocancel writev_nocancel_nostatus.
* sysdeps/mach/hurd/not-cancel.h (__writev_nocancel_nostatus): Replace
macro with function declaration (with hidden prototype in libc).
(__writev_nocancel): New function declaration (with hidden prototype in libc).
* sysdeps/mach/hurd/writev_nocancel_nostatus.c: New file.
* sysdeps/posix/writev_nocancel.c: New file, includes writev.c to make a
nocancel variant that calls __write_nocancel.
* sysdeps/posix/writev.c (writev): Do not define alias if __writev is
renamed.
Diffstat (limited to 'sysdeps/mach/hurd/writev_nocancel_nostatus.c')
-rw-r--r--sysdeps/mach/hurd/writev_nocancel_nostatus.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/sysdeps/mach/hurd/writev_nocancel_nostatus.c b/sysdeps/mach/hurd/writev_nocancel_nostatus.c
new file mode 100644
index 0000000000..6db24d1b53
--- /dev/null
+++ b/sysdeps/mach/hurd/writev_nocancel_nostatus.c
@@ -0,0 +1,28 @@
+/* Copyright (C) 1991-2020 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <errno.h>
+#include <not-cancel.h>
+
+void
+__writev_nocancel_nostatus (int fd, const struct iovec *vector, int count)
+{
+  int save = errno;
+  __writev_nocancel (fd, vector, count);
+  __set_errno (save);
+}
+libc_hidden_weak (__writev_nocancel_nostatus)