From patchwork Sun Feb 9 20:20:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 37815 X-Patchwork-Delegate: carlos@redhat.com Received: (qmail 21933 invoked by alias); 9 Feb 2020 20:20:36 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 21816 invoked by uid 89); 9 Feb 2020 20:20:35 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=Trying X-HELO: us-smtp-delivery-1.mimecast.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1581279632; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7TeEWAYC+KBJCgJU9d9shgYWgArFm5C/73Epc6xlbcg=; b=VyP/w/kBU9aPuTnuSbVUB1lNErBOX+OyQ4vtxjY35rdqBpiN7C/z4KheX8uqfjVEi/i/7R Pt/Gl7AzmYldEXD5bCs3hi8R4iTsuNhuoNGaIrsozf34PoNSJij6T+yJIZXYgCl+PYD5OO MMBbu4bLuqtBXt521Lj0DxcxFrhwXd8= From: Florian Weimer To: libc-alpha@sourceware.org Subject: [PATCH 11/26] Linux: Clean up preadv2, pwritev2 system call names In-Reply-To: References: X-From-Line: eb11588418eb6dcc96a4fac9dc0c27c5fe43134a Mon Sep 17 00:00:00 2001 Message-Id: Date: Sun, 09 Feb 2020 21:20:23 +0100 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com With the built-in tables __NR_preadv2 and __NR_pwritev2 are always defined. The kernel has never defined __NR_preadv64v2 and __NR_pwritev64v2 and is unlikely to do so, given that the preadv2 and pwritev2 system calls themselves are 64-bit. Reviewed-by: Adhemerval Zanella --- sysdeps/unix/sysv/linux/preadv2.c | 7 +------ sysdeps/unix/sysv/linux/preadv64v2.c | 9 ++------- sysdeps/unix/sysv/linux/pwritev2.c | 4 ++-- sysdeps/unix/sysv/linux/pwritev64v2.c | 9 ++------- 4 files changed, 7 insertions(+), 22 deletions(-) diff --git a/sysdeps/unix/sysv/linux/preadv2.c b/sysdeps/unix/sysv/linux/preadv2.c index 5f1a83589e..4e3aa923da 100644 --- a/sysdeps/unix/sysv/linux/preadv2.c +++ b/sysdeps/unix/sysv/linux/preadv2.c @@ -21,20 +21,15 @@ #ifndef __OFF_T_MATCHES_OFF64_T -# if !defined (__NR_preadv2) && defined (__NR_pread64v2) -# define __NR_preadv2 __NR_pread64v2 -# endif - ssize_t preadv2 (int fd, const struct iovec *vector, int count, off_t offset, int flags) { -# ifdef __NR_preadv2 ssize_t result = SYSCALL_CANCEL (preadv2, fd, vector, count, LO_HI_LONG (offset), flags); if (result >= 0 || errno != ENOSYS) return result; -# endif + /* Trying to emulate the preadv2 syscall flags is troublesome: * We can not temporary change the file state of the O_DSYNC and O_SYNC diff --git a/sysdeps/unix/sysv/linux/preadv64v2.c b/sysdeps/unix/sysv/linux/preadv64v2.c index f1e52711cb..1bf1a4c696 100644 --- a/sysdeps/unix/sysv/linux/preadv64v2.c +++ b/sysdeps/unix/sysv/linux/preadv64v2.c @@ -19,20 +19,15 @@ #include #include -#if !defined(__NR_preadv64v2) && defined(__NR_preadv2) -# define __NR_preadv64v2 __NR_preadv2 -#endif - ssize_t preadv64v2 (int fd, const struct iovec *vector, int count, off64_t offset, int flags) { -#ifdef __NR_preadv64v2 - ssize_t result = SYSCALL_CANCEL (preadv64v2, fd, vector, count, + ssize_t result = SYSCALL_CANCEL (preadv2, fd, vector, count, LO_HI_LONG (offset), flags); if (result >= 0 || errno != ENOSYS) return result; -#endif + /* Trying to emulate the preadv2 syscall flags is troublesome: * We can not temporary change the file state of the O_DSYNC and O_SYNC diff --git a/sysdeps/unix/sysv/linux/pwritev2.c b/sysdeps/unix/sysv/linux/pwritev2.c index 53ab5e7613..a179654970 100644 --- a/sysdeps/unix/sysv/linux/pwritev2.c +++ b/sysdeps/unix/sysv/linux/pwritev2.c @@ -25,12 +25,12 @@ ssize_t pwritev2 (int fd, const struct iovec *vector, int count, off_t offset, int flags) { -# ifdef __NR_pwritev2 + ssize_t result = SYSCALL_CANCEL (pwritev2, fd, vector, count, LO_HI_LONG (offset), flags); if (result >= 0 || errno != ENOSYS) return result; -# endif + /* Trying to emulate the pwritev2 syscall flags is troublesome: * We can not temporary change the file state of the O_DSYNC and O_SYNC diff --git a/sysdeps/unix/sysv/linux/pwritev64v2.c b/sysdeps/unix/sysv/linux/pwritev64v2.c index ba95eefcd9..8df32528b7 100644 --- a/sysdeps/unix/sysv/linux/pwritev64v2.c +++ b/sysdeps/unix/sysv/linux/pwritev64v2.c @@ -19,20 +19,15 @@ #include #include -#if !defined(__NR_pwritev64v2) && defined(__NR_pwritev2) -# define __NR_pwritev64v2 __NR_pwritev2 -#endif - ssize_t pwritev64v2 (int fd, const struct iovec *vector, int count, off64_t offset, int flags) { -#ifdef __NR_pwritev64v2 - ssize_t result = SYSCALL_CANCEL (pwritev64v2, fd, vector, count, + ssize_t result = SYSCALL_CANCEL (pwritev2, fd, vector, count, LO_HI_LONG (offset), flags); if (result >= 0 || errno != ENOSYS) return result; -#endif + /* Trying to emulate the pwritev2 syscall flags is troublesome: * We can not temporary change the file state of the O_DSYNC and O_SYNC