From patchwork Wed Aug 5 18:59:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 40216 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 782B4388C012; Wed, 5 Aug 2020 18:59:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 782B4388C012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1596653969; bh=PF5U7tTD47tIeX+Al83g/rSqqGnO0NFZUg7lZPhn0dY=; 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=Fg0Mb26uN823HkPmVK+JkGAvJ+cG8v4RhYL9heJ6Qlznn3B/5Jd1hst0Z/bN3fogV hrzL5sQBiIn1OHhDkTpnXo7wP0eIfOFE7jKIv99xE8YBtKAGca/z/WCIMJBDtlaGAB NrASG/H56PxB7fNhdPrJAPs3hJHfQBYDR4JYxe0A= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by sourceware.org (Postfix) with ESMTPS id A158C388C00B for ; Wed, 5 Aug 2020 18:59:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A158C388C00B Received: by mail-qk1-x742.google.com with SMTP id x69so42737115qkb.1 for ; Wed, 05 Aug 2020 11:59:26 -0700 (PDT) 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=PF5U7tTD47tIeX+Al83g/rSqqGnO0NFZUg7lZPhn0dY=; b=ZI7d9AA2ySkkiWUcgYFWD9PUiIzPZsAYpVD7JeL6gDimv4i75LtB1XGoSJkmo9esHB RCbNXK3/JrVPjtH2bXfUHyiri+7NemGe2NWFSJph46CjkMyXg+os6+4LgR/VyNacP1lJ YfQDQykBTmgRTGzfjcwD1mytNDk5iJoH8MENdOUAOqOZWOTOFSx75TxADRae1DCF1A40 l0HKDKysQNubLM9N/mvbtBlwzmB9y0Bjs0OTKKdfpPYUiMgvDbLVV2ZwWYuOCBmCexWx 4RH02nBTmz1MbXDaydbEAPSKkI5tcj/Cp0FYkX01yXidJZnLzBE+tlKHa17phKfxy5OM /tFw== X-Gm-Message-State: AOAM533K/H8iTfXqnRuOzaRWBSrKGZWr/P2By3adpuRaik8XTMJMmt/H /x5Bt8GS1S/EzKiYqr8/0hHcgU4OXu25rQ== X-Google-Smtp-Source: ABdhPJymrSnlWzwtiAH6U4VHJV8my62smNOxKYopvQKsLJ3NhfNCEWu7wMwF5EqWUrhRsYXbhJDrOg== X-Received: by 2002:a05:620a:889:: with SMTP id b9mr4820468qka.7.1596653965919; Wed, 05 Aug 2020 11:59:25 -0700 (PDT) Received: from localhost.localdomain ([177.194.48.209]) by smtp.googlemail.com with ESMTPSA id l13sm2610088qth.77.2020.08.05.11.59.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 11:59:25 -0700 (PDT) To: libc-alpha@sourceware.org Subject: [PATCH v2 5/7] linux: Add pwrite64_nocancel Date: Wed, 5 Aug 2020 15:59:13 -0300 Message-Id: <20200805185915.2025314-5-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200805185915.2025314-1-adhemerval.zanella@linaro.org> References: <20200805185915.2025314-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-13.8 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 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 + . */ + +#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)