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: 76708 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 4C9763850867 for ; Tue, 26 Sep 2023 13:44:02 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id A38933854143 for ; Tue, 26 Sep 2023 13:43:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A38933854143 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-wr1-x436.google.com with SMTP id ffacd0b85a97d-323344eae8eso1642982f8f.1 for ; Tue, 26 Sep 2023 06:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ionos.com; s=google; t=1695735822; x=1696340622; darn=sourceware.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=De2rYFgCFWkP+fAVvIgK+gTZ2lbH5omqzDPtEjbNkuRAPf9Ty4dYnr9W4Pl5eg3VxP VjRXmvZP+5dg4VqoO/qCQVPvn1NMPANFSCzAd0O5O1rwEVRJnEUeCuaLZT7Ie0Ij4IWa Kzndl5tvATGGZ+jlzgs5mAYWDdTPnczmBFV2zCDNfVq+uOWc+C+c2AraDCEenu8NXeJy pih+dznOkQWTAaYRC4sOQ+7ZJ9UlrMzMLwmsaYLsAWWsjS28/un9OHhARE3EEXxyLk0/ LfxFXEh5c8L9UblfYIbvxOgwdUW/U6vUnVu6lSe7/aRe1dmXA9gFljIb3ILksF0IhsOJ 6qEg== 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=Rqtvsc8aGRtugzhItrta68FBhcsuwgRJYvaQJLRKTgq+SnXBEakhNLVJlxFfD0oYD9 WFqDVQEi3RZvTgoFwjsXzqj++3FdvSOnZTu+91HoXDLmg217+pDn9Op5Ix8R/HJVqoMa NoYhaEW+Qv+4AdVTn8fi/i8awcwqMH3Tv+jR/ZXPrqyOCkc2gVoussscOBSuqLKPqHWj IvPXR2MWl8dZn9h09rFXGMJBXw0V18WmDqvqHGVEid9luEo0D5Ux2/i3eeZIoeADWfox 8LZiWlfs6eiJiczgRkVdYS69t8ARS4R/0p/3bOVZkKoftNSmwtOzZZEgVLb7CYI4fptj D+nQ== X-Gm-Message-State: AOJu0Yz5WhdZB7l34Y9P5IqjZbwcvV7KaEz0nUsArdqSr3O/+jUb66jN n+300x97grdJL/TDEp+Ak9fksQ== X-Google-Smtp-Source: AGHT+IGQUe3IdNmMk57bmfL8PJu8M+EYO3SZyr5D1RurisMB/DzXyNogPvyzvVGvHPFXaPY+8ZIKlA== 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=-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 | 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 (),