From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: libc-alpha@sourceware.org
Subject: [PATCH v2 5/7] linux: Add pwrite64_nocancel
Date: Wed, 5 Aug 2020 15:59:13 -0300 [thread overview]
Message-ID: <20200805185915.2025314-5-adhemerval.zanella@linaro.org> (raw)
In-Reply-To: <20200805185915.2025314-1-adhemerval.zanella@linaro.org>
It is not used internally yet.
---
sysdeps/unix/sysv/linux/Makefile | 2 +-
sysdeps/unix/sysv/linux/not-cancel.h | 4 +++
sysdeps/unix/sysv/linux/pwrite64_nocancel.c | 29 +++++++++++++++++++++
3 files changed, 34 insertions(+), 1 deletion(-)
create mode 100644 sysdeps/unix/sysv/linux/pwrite64_nocancel.c
diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile
index 39305c97e7..682f4af55d 100644
--- a/sysdeps/unix/sysv/linux/Makefile
+++ b/sysdeps/unix/sysv/linux/Makefile
@@ -273,7 +273,7 @@ sysdep_routines += xstatconv internal_statvfs internal_statvfs64 \
close_nocancel fcntl_nocancel \
open_nocancel open64_nocancel \
openat_nocancel openat64_nocancel \
- read_nocancel pread64_nocancel \
+ read_nocancel pread64_nocancel pwrite64_nocancel \
write_nocancel statx_cp stat_t64_cp
sysdep_headers += bits/fcntl-linux.h
diff --git a/sysdeps/unix/sysv/linux/not-cancel.h b/sysdeps/unix/sysv/linux/not-cancel.h
index bf09a3d6b8..d2e46be35b 100644
--- a/sysdeps/unix/sysv/linux/not-cancel.h
+++ b/sysdeps/unix/sysv/linux/not-cancel.h
@@ -46,6 +46,9 @@ __typeof (__read) __read_nocancel;
/* Non cancellable pread syscall (LFS version). */
__typeof (__pread64) __pread64_nocancel;
+/* Non cancellable pwrite syscall (LFS version). */
+__typeof (__pwrite64) __pwrite64_nocancel;
+
/* Uncancelable write. */
__typeof (__write) __write_nocancel;
@@ -78,6 +81,7 @@ hidden_proto (__openat_nocancel)
hidden_proto (__openat64_nocancel)
hidden_proto (__read_nocancel)
hidden_proto (__pread64_nocancel)
+hidden_proto (__pwrite64_nocancel)
hidden_proto (__write_nocancel)
hidden_proto (__close_nocancel)
hidden_proto (__fcntl64_nocancel)
diff --git a/sysdeps/unix/sysv/linux/pwrite64_nocancel.c b/sysdeps/unix/sysv/linux/pwrite64_nocancel.c
new file mode 100644
index 0000000000..06d0ae14d0
--- /dev/null
+++ b/sysdeps/unix/sysv/linux/pwrite64_nocancel.c
@@ -0,0 +1,29 @@
+/* Linux pwrite64() syscall implementation -- non-cancellable.
+ Copyright (C) 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
+ <http://www.gnu.org/licenses/>. */
+
+#include <unistd.h>
+#include <sysdep-cancel.h>
+#include <not-cancel.h>
+
+ssize_t
+__pwrite64_nocancel (int fd, const void *buf, size_t count, off64_t offset)
+{
+ return INLINE_SYSCALL_CALL (pwrite64, fd, buf, count,
+ SYSCALL_LL64_PRW (offset));
+}
+hidden_def (__pwrite64_nocancel)
--
2.25.1
next prev parent reply other threads:[~2020-08-05 18:59 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-05 18:59 [PATCH v2 1/7] login: Move gnu utmpx to default implementation Adhemerval Zanella
2020-08-05 18:59 ` [PATCH v2 2/7] Consolidate and simplify internal utmp definitions Adhemerval Zanella
2020-08-05 18:59 ` [PATCH v2 3/7] support: Add 'touch' command Adhemerval Zanella
2020-08-05 19:08 ` DJ Delorie
2020-08-05 18:59 ` [PATCH v2 4/7] login: Add 64-bit time support to utmp/utmpx Adhemerval Zanella
2020-08-05 19:28 ` Joseph Myers
2020-08-05 20:35 ` Adhemerval Zanella
2020-08-05 20:43 ` Joseph Myers
2020-08-05 20:54 ` Adhemerval Zanella
2020-08-05 18:59 ` Adhemerval Zanella [this message]
2020-08-05 18:59 ` [PATCH v2 6/7] login: Use 64-bit time on struct lastlog Adhemerval Zanella
2020-08-05 19:56 ` Florian Weimer
2020-08-05 20:36 ` Adhemerval Zanella
2020-08-05 18:59 ` [PATCH v2 7/7] Remove __WORDSIZE_TIME64_COMPAT32 Adhemerval Zanella
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200805185915.2025314-5-adhemerval.zanella@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).