From patchwork Tue Sep 26 07:04:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 76675 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 6C4F838560B9 for ; Tue, 26 Sep 2023 07:04:32 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-ed1-x52b.google.com (mail-ed1-x52b.google.com [IPv6:2a00:1450:4864:20::52b]) by sourceware.org (Postfix) with ESMTPS id 04AD0385CC8C for ; Tue, 26 Sep 2023 07:04:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 04AD0385CC8C Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=ionos.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=ionos.com Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-52bd9ddb741so9312929a12.0 for ; Tue, 26 Sep 2023 00:04:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1695711847; x=1696316647; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=09Dbusezuzmtem8SHw0UyQKQ5oAulzPz0jwJbZlkunI=; b=GUeK8dD843DN+eHKz5YVAIo7DP99Ny/7F5yt41NFLpmyin94Hf7txUB2w2CPGovPaK e1FsiUqOreARV+Ryh8T76FuLtUyKJwBnSZZKWQX+4W7TbAQ0EpjvNlqEl4ifTAJ4/9US gCCXptHbl3WoUmA+ZLrhisrjNBHCv7M8l+7i7ucmxoONqVS8QXMbcoA3msB5XtthlNYc YOMZT9PszMWPNV6LjBi7PyNwAVpo9pmmP+T/qw2EhOg2etS0N3sEqZGPhIpysyHOuKTx TDvQUY4KJYaFT6oPMY/5zj5qkdec9Gn1YSIFTP/MMgOgoEZ3iSmE6cGB/t6diQuxd98G VvNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695711847; x=1696316647; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=09Dbusezuzmtem8SHw0UyQKQ5oAulzPz0jwJbZlkunI=; b=UJtFEKwIyV2NN2G5SQdqMEJtdX4zLfnGnFxLa/WG1Yl6Y5VCOrraFske3aYA0wstuS ciJ0kPSA80JPDbtUt2MJDFcrYGzv6LKx6o8UBnKjeKZAj2ydZGxyn2+US7lgFCgl+610 sjIQVOfPZSobzMFrcwXXQMs/rcihDseEv0NjR7us7E0G8eKUGVJAxOxlldpB7GM+LraT SG0/CV05/zGHsldrYFLWCeX080QtkFP4rnHZPEMqdthC2iFEsHfhRj6vz3HMf5x6oWDS Sw01FbMLXKcBdJYNaTUcj6znOWNXc7C5Z4FNdd0Gs/Xy0awMU+eh1BdmXyiCMoU+DQuN LjNg== X-Gm-Message-State: AOJu0Yx18LHP4SXVxb1IRH+lo8+ZZTQCKZNICenuxUdzPGt/aHyBV4CZ /3fRh1Y34WL1O1F7S09kIdUtpA== X-Google-Smtp-Source: AGHT+IFkDpIma3t+/zuXOt8GN+pMsASgXkfBA+WDQYHttvUk1ozw24xulRvXJIA0TTUhcKtepHK5vQ== X-Received: by 2002:a17:907:1dd7:b0:9a1:f5b1:c864 with SMTP id og23-20020a1709071dd700b009a1f5b1c864mr7364977ejc.10.1695711846644; Tue, 26 Sep 2023 00:04:06 -0700 (PDT) Received: from heron.intern.cm-ag (p200300dc6f49a600529a4cfffe3dd983.dip0.t-ipconnect.de. [2003:dc:6f49:a600:529a:4cff:fe3d:d983]) by smtp.gmail.com with ESMTPSA id q9-20020a170906540900b009930042510csm7387982ejo.222.2023.09.26.00.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 00:04:06 -0700 (PDT) From: Max Kellermann To: alx@kernel.org, linux-man@vger.kernel.org, brauner@kernel.org, axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, libc-alpha@sourceware.org, Max Kellermann Subject: [PATCH] man2/splice.2: document SPLICE_F_NOWAIT Date: Tue, 26 Sep 2023 09:04:02 +0200 Message-Id: <20230926070402.2452760-1-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org Patch for SPLICE_F_NOWAIT submitted to LKML: https://lore.kernel.org/lkml/20230926063609.2451260-1-max.kellermann@ionos.com/ In the HISTORY section, I declared Linux 6.7 as the first version to have this feature, but this is only speculation, because SPLICE_F_NOWAIT is still under discussion and has not yet been merged. Signed-off-by: Max Kellermann --- man2/splice.2 | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/man2/splice.2 b/man2/splice.2 index e9a18e668..1e686b858 100644 --- a/man2/splice.2 +++ b/man2/splice.2 @@ -89,13 +89,27 @@ call); in the future, a correct implementation may be restored. .TP .B SPLICE_F_NONBLOCK -Do not block on I/O. +Do not block on I/O on pipes. This makes the splice pipe operations nonblocking, but .BR splice () may nevertheless block because the file descriptors that are spliced to/from may block (unless they have the .B O_NONBLOCK -flag set). +flag set or +.B SPLICE_F_NOWAIT +is specified). +.TP +.B SPLICE_F_NOWAIT +If no data is immediately available on +.I fd_in +and it is not a pipe, do not wait (e.g. for backing storage or locks), +but return immediately with +.B EAGAIN. +This is analogous to the +.B RWF_NOWAIT +flag of +.BR preadv2() +. .TP .B SPLICE_F_MORE More data will be coming in a subsequent splice. @@ -138,6 +152,8 @@ is set to indicate the error. .TP .B EAGAIN .B SPLICE_F_NONBLOCK +or +.B SPLICE_F_NOWAIT was specified in .I flags or one of the file descriptors had been marked as nonblocking @@ -192,6 +208,9 @@ was required to be a pipe. Since Linux 2.6.31, .\" commit 7c77f0b3f9208c339a4b40737bb2cb0f0319bb8d both arguments may refer to pipes. +.PP +.B SPLICE_F_NOWAIT +was added in Linux 6.7. .SH NOTES The three system calls .BR splice (),