From patchwork Tue Sep 26 13:43:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Max Kellermann X-Patchwork-Id: 144935 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:cae8:0:b0:403:3b70:6f57 with SMTP id r8csp1985829vqu; Tue, 26 Sep 2023 08:08:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEm1PjZI4RinIf7qHUO+q6zFB5Fyv/ttzCz0BQ/nR8fPHPH9TlSAOlfAau2JLj206Dhs+IR X-Received: by 2002:a05:6a20:9709:b0:133:d17d:193a with SMTP id hr9-20020a056a20970900b00133d17d193amr9340541pzc.59.1695740898955; Tue, 26 Sep 2023 08:08:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695740898; cv=none; d=google.com; s=arc-20160816; b=nPKDNljkKkgom7zcerraa9fxMhyCYm7UHXkuJ2t+Kqq1C8RMaRiItoIY+QRdJ9S/WL peX4hS8kyX1eawZYZm17dZ9NQ8mMpCVZKb2Ovfpp2RdV3S7hKtsa+/t3OId6ONPQDy14 O+toKTOjJQCO7FspVz8VCwN6edn8sNwCHcoDYoe1gpiV6ZME4gRlql1msP6JDRLzh+Ki FNzxmWWwwU3RqwLyCpCCcYZeKnKwWiDo/l8M6gSXgQA/mo/FxW8Njjxz/4xV8licnBIC C9wnq/FOj6JiWuOEYn7xL4tIpMs/SobbJ4Z/3i/zjHBaYJhyo+f/C7mAt0idCQTt3+/v fSjg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ptamfMpXoJ3CODle1KvFafVhoHAycVMWOruc5QELg+E=; fh=dRfzida3nps+qLHWRAEmu/22J2CisFryXKFoMU0NiWg=; b=swByTQIf6+JEBEKLU4B9VVXcR/HevJHMbCAgvY+V2y8/PJFoUQwf63k98qW6Gzjcs0 qXi/ITI3LX79DqeMSSkniMlIfR6eABLdFx1jKxFCAwCIVFK6eOSBiJJLOsmi+WlMBMBG pMxJQA/YxtiE3TqocCnadgdpOS+r6qIHCrPYg4oE8qF8i7bNdxniDRTOw9NNWkWSFHIL dHpQgj6uv0n8Pz07iei+9RfHzUgSNUP45hOCZ6ky9fXdxLzpIdbldIeLzllLNfC0ECfn nPUxK8TwEC9vOwWRWwMr+whxIJFc2i/EJoRiY8jUb2zzzjvbmInCcrDZFBKUDFWE6fyQ YZHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=gFiLzWvg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id b13-20020a056a000ccd00b00690f74dd2ccsi13448822pfv.69.2023.09.26.08.08.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 08:08:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@ionos.com header.s=google header.b=gFiLzWvg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 5278A80D7E48; Tue, 26 Sep 2023 06:43:51 -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 S234850AbjIZNnw (ORCPT + 28 others); Tue, 26 Sep 2023 09:43:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234846AbjIZNnv (ORCPT ); Tue, 26 Sep 2023 09:43:51 -0400 Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EE933F3 for ; Tue, 26 Sep 2023 06:43:43 -0700 (PDT) Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-32333fb6beeso1802381f8f.0 for ; Tue, 26 Sep 2023 06:43:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1695735822; x=1696340622; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ptamfMpXoJ3CODle1KvFafVhoHAycVMWOruc5QELg+E=; b=gFiLzWvgNJVmF699Cqrqu4+R2LyjPqbMaVQK71IZzRhA9854OzKw8FWriPbCA9+3vO TarL1CLrD40m57jQTX6e/RfvM6lz9fmFOdcAF17Eny5ebKgRpXXkc70dBGroWQZLvFMI cl1mZrrM6pQ28VKoy6qf92BAmSUhUeBM5inzsfXi0NgqhNGutAqkC3qhTwy+yKp49Ows tPaIFQPEbBcpMRN7unIsY8pb4bjZwAwhM7IAQyaAbA65mBPf2C0hq7ij3nMpKlIP77fg a2LJTbE9DD0HgA7tcrb+6R2vnfzvjl+SQZLopnrItRI5hUvPRxFmVasvuoIKqqrloi37 eDaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695735822; x=1696340622; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ptamfMpXoJ3CODle1KvFafVhoHAycVMWOruc5QELg+E=; b=s5AFdI4WSRH7iwyDRLgXb7p1l5VEyGDRLpKqX5KecByew4X7mdmEyFr9J0r1EwUtd+ OHRKBfnKh/zQlQQuJAj7O6jwyZRQY0EkmYTioHVblblnxJegK6+9JI0GndJF7LtFqCaS bvXFqhqwMxYVsKEnBH3qyogEkOcgk7Zc/a7XFbj11tT1Oiut/FZrMbceFjAtbNtvvuCh W8LFIqbRQgXmhhfgOkVnpBKvY1AuDp8YR/fGEEs3ggh6pr9vWd+1rtSAT1mDJg3DrThE asWlij31v8qp7EHRm6xEl5sMA9CnFaX4i5s5nW7G0wGEO8zKg85+5TTQtET7PPx16TXC 5DSA== X-Gm-Message-State: AOJu0YxEXteohTvPDXU+tJiyGIOGb2lXw+865rpPNDkUaUOhj2raUaXP GgzhTZV9WU5AHI1HloUqo6U5d2L62EcUXVILFpQ= X-Received: by 2002:adf:ed0d:0:b0:315:9676:c360 with SMTP id a13-20020adfed0d000000b003159676c360mr8793528wro.25.1695735822316; Tue, 26 Sep 2023 06:43:42 -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 o13-20020a5d474d000000b003217cbab88bsm14644490wrs.16.2023.09.26.06.43.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Sep 2023 06:43:41 -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 v2] man2/splice.2: document SPLICE_F_NOWAIT Date: Tue, 26 Sep 2023 15:43:39 +0200 Message-Id: <20230926134339.2919289-1-max.kellermann@ionos.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: References: 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_BLOCKED, 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 06:43:51 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1778095086230252439 X-GMAIL-MSGID: 1778113209027862248 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 | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/man2/splice.2 b/man2/splice.2 index e9a18e668..a07c001ac 100644 --- a/man2/splice.2 +++ b/man2/splice.2 @@ -89,13 +89,26 @@ 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 +151,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 +207,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 (),