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: 144805 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1805460vqu; Tue, 26 Sep 2023 03:20:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF/3O6RRsN7Jt7L1zoTnRlsmIXVXFslEWwH72AJrp05HAkHS5pr6EdflHeGQzqkaKosSSdF X-Received: by 2002:aa7:8886:0:b0:690:ce30:47e5 with SMTP id z6-20020aa78886000000b00690ce3047e5mr8167685pfe.6.1695723616003; Tue, 26 Sep 2023 03:20:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695723615; cv=none; d=google.com; s=arc-20160816; b=BqGk2X4WFVQuB0c92Cxu1YDZVxjJ/bABHj/oqcpOR4g58ry1xlhkPowQCiSRRSadwG saizQpAi8N9AIo0QW9HcbF6K6dbuy4tK8Rm21DU9f99QiV+zPn3bxYd0hhR2hanS+BgN A1zQtvgTKXvKvH7nubEEaQn1b2DqVvXnRRS4d9omL9zJtIUx2pD/m5SAovtKgn7sG1Nm N9y3LheBl8bmgL8laG51tFGxYtHlItlsKkoXTrtseHFU4qBKC2Il5/8wmCZ6EP7W4G+Y kEa033GlANBl2osbQAPTwWTheHr9gledotKBnOu2tGwYIRzAERdzY7Buy+YjjfUIaspW f0HQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=09Dbusezuzmtem8SHw0UyQKQ5oAulzPz0jwJbZlkunI=; fh=dRfzida3nps+qLHWRAEmu/22J2CisFryXKFoMU0NiWg=; b=PE2sRMi/IyJgSctiQt61PVtQyDzfhpyT2C5JIF9uCn0wEFeCCEXkQHnD6j4vKB+kL6 b24KhtZdVKEz4dKQNy4hhlAWU2OfEU/YGt5jGYcewupGa9re8fnYZ5odjtQB4ybvi5cF c9R1Q1OI0vOUlW8YZhS5FKM81jHWui8gOPLw1T6+MSIbIJHDUug261l8A0sluGaRCYT9 IKo+LIL56EHXqazc38sMhFr2quGAGkeKeN0Fv8dLBf42EDoE5ZgAqf2cEjwQMzoxhevx /U6KYNY3sv98juYbJBx+hKMzHWwQmpj7pUq2cZh6JvMmAMEiJfSU8CgOOZ+80nUhorOM xmZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="YFUvFE/m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z5-20020aa78885000000b00690fd7e8f85si13068918pfe.396.2023.09.26.03.20.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 03:20:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b="YFUvFE/m"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ionos.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 54A1B80FC716; Tue, 26 Sep 2023 00:04:23 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231549AbjIZHES (ORCPT + 27 others); Tue, 26 Sep 2023 03:04:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230097AbjIZHEP (ORCPT ); Tue, 26 Sep 2023 03:04:15 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51903FF for ; Tue, 26 Sep 2023 00:04:08 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9a9d82d73f9so969670966b.3 for ; Tue, 26 Sep 2023 00:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1695711846; x=1696316646; darn=vger.kernel.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=YFUvFE/mH3/+vBDA0Ft/PlefIUy7eWIGkUHkrxa5TdonuHq5xJG5raPHiPKLmVtm7O GWDvvTYgqte28Sz16dteKtvoqKU4DiUzTLIN1RGu5FD2iXYMkm2c6b1g0b8d/bLTdt7A XhdYyS8+E8XrJw4P+1ELSx23JsWemQPb7zym10/oVl/54UUhDZzxaF0YcU3Rf0pJyRA7 hfsRGvGAkw5zq4LZrdYPYuInOeCoBlwIoMn1H1kOiMZ9AmnTluHzzEGM4MiTx6UAEip3 7qNsSgqplpJFo3uPwSs6+NLI8JAcEGOFIqgqeTgx2oS5S19/A3bUt56K3VJ57i1VRIw9 Y4yQ== 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=Xvua08d+aW8VqFPLX354otjozBAImoRm/tunrwA1CUxDjCOWyaEXA2eUFpYAL8WnLU X6NRqGPAoA2lChUlgMIKD5E3hdpksDQuFfVgMoO9v6pK2k1QzA/8aIaFd78lZlC4oZhJ b5tTTKxq03FDwYhwyh30tFxIQweNHUiaKqNLbUaffpSih8kdH/H+zhTRrn4h7PLxyN5h 3sHw7iY2qM93kJKOK8ciDwzzojI+ouECR7Nr97A9tFrP2VDdaci2I45KF2wmauUzBBYV sIEdZujPw8IH5VJ1ujhH5k7EuOMhNovR9XQd/Gn8FS9iWHsVIBluFsYOm6oHZPMGBvql dLAg== X-Gm-Message-State: AOJu0YxgOvBzagggtVVPFGX+B0Lp/MEtJKM+Km1T6658iNCH8rgOkStc 9UePrcs4WZDM4Mxbar3qcOo2kA== 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=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 26 Sep 2023 00:04:23 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778095086230252439 X-GMAIL-MSGID: 1778095086230252439 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 (),