From patchwork Fri Mar 5 20:14:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 42302 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id EC306399C037; Fri, 5 Mar 2021 20:15:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC306399C037 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614975352; bh=rLyMxChGAwfT8ViPC1zThax+pyHuxeqDi0CyoG/0EDI=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=JFjuIvWxWb6KuNSq5zyYLYAU+XjYdm3hcSjz/cQ2TCgkoLkHeU4tTIhAmhhU6+zz6 pInbU0NPBI2velUdtA7kxPUkTt8OAz9QYbSFLJ3Vz5fxARITQAcaCHrD6zw+PKkhJh 8+3MlcWm3OoNAGdaj7er9gg8W01uTvZHfQKSwxeE= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) by sourceware.org (Postfix) with ESMTPS id E0DD1399C029 for ; Fri, 5 Mar 2021 20:15:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E0DD1399C029 Received: by mail-qv1-xf30.google.com with SMTP id h7so1638399qvm.2 for ; Fri, 05 Mar 2021 12:15:48 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rLyMxChGAwfT8ViPC1zThax+pyHuxeqDi0CyoG/0EDI=; b=WAHiJPxpAhiDYaxsCgHYaX1YOCsL4ZXzEgfBOWaYVpf+BPHmzBeP5ybD0RU/35Asvu oGU2fJlxo84/w2pf7UQQ3JhfaCJOqqZgA0gxgJ/tVt8/zrh+bbLujkX94T+0bAm9FS22 AkILuUXxRC6cYuQgnJjqXrUG68CtVl4uvEjdlvTun/qE0Lic25KZRg3YjOn+fmJgSII3 W5eSLAstsGerXC4i+Zn7JKOR1r/lwgBH1O84utxoOrisD8HnxEKSJJx8+Ze7MI/UGyrC KnnP3iaqRpx+DLATlnG14uPH0bxPrw1RwMLrnGAPZNJEDfPUf9V/fKnz9MkI83nZ9Hbc wMEA== X-Gm-Message-State: AOAM530iPEebIEsniTSuqhucSHKLNQmUKwsgcfQHtOTP20skOhAaVL3Q IWH+KReHwNE6yg69MgWG/Opmix5ejEl8Tw== X-Google-Smtp-Source: ABdhPJzUb2gYpEalmilT2/AgynyzuYLm+tunkPv1bS0mDSL50zKvrMeHR/5tISPE+pFzj6hu9YWFpw== X-Received: by 2002:ad4:5ecc:: with SMTP id jm12mr10675308qvb.33.1614975348383; Fri, 05 Mar 2021 12:15:48 -0800 (PST) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id c5sm2526145qkl.21.2021.03.05.12.15.47 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Mar 2021 12:15:48 -0800 (PST) To: libc-alpha@sourceware.org Subject: [PATCH 21/52] linux: Add pwrite64_nocancel Date: Fri, 5 Mar 2021 17:14:47 -0300 Message-Id: <20210305201518.798584-22-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210305201518.798584-1-adhemerval.zanella@linaro.org> References: <20210305201518.798584-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Adhemerval Zanella via Libc-alpha From: Adhemerval Zanella Netto Reply-To: Adhemerval Zanella Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" 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 b206f77594..7b3bb30da2 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -280,7 +280,7 @@ sysdep_routines += xstatconv internal_statvfs \ 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 f06d57426a..27bb3811af 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 + . */ + +#include +#include +#include + +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)