From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by sourceware.org (Postfix) with ESMTPS id F08123851C24 for ; Wed, 24 Mar 2021 22:43:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F08123851C24 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=alyssa.is Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=hi@alyssa.is Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id E75A112FF; Wed, 24 Mar 2021 18:43:00 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Wed, 24 Mar 2021 18:43:01 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=V5aqQMwIH+aJrflOU6PFOzyKU3 mL0kL7+T6R4DQaaYQ=; b=O1ajeQQx/0u1opTEQvfPWNC4fmUWgA9XSDBqUeqIFM MwCG2hks+smQzCCZqf/DrobdX+5uah9UceZN2zKJ+JglhA7n0ows2UixyoXAZ79L cUMBPOn2Eh70mEWkSC51f/JcdlwE1VliAnGw5Jh3vUCCdYwldFJYrd25aoF8EFfJ 0vxf1DMS6dmJFLupukQw0J7cz4BInTh6H4OILqKBXV+4vzxhF+m+CQHKflBNh+Vr xKXFBMJhrk8bYf9w7MZ9OBWzZAOhOlF3IL2SQyV23D5UHjMahelTMpXg9x8aN3YG AmIAk77gvZud/rERA/hTdFmo0ixqXvQeyz0Nf00VJ/Xw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=V5aqQM wIH+aJrflOU6PFOzyKU3mL0kL7+T6R4DQaaYQ=; b=DbprA220JcbU/Z1gflsl0N vw/aNi2HtW+E/Oi/7faOXu/qkT/2MoWTliP0wLT9BrDBKowQorwXtKmTnQd6LRc3 9QYXo64uuJzGu6Zk/08jiI1FRseEFWpHlgR8N1XyQR5Ft+8Aq67u8dtTKFpi6t0M s2pTYxWlePj+5QNrol6atxWfQQx4OP9cNVsBTiOiPKxI/dahQ8ggdPMWp3Bno+n4 pIoorW6EV2BDCL4Qa5Mm1PsSCNZoqxzFEW4v483cFhz/v3uaZmTzBn5ledXjklgO At2LU9kvT6W7rtcBR2bGbeuVq9qdOHes37gu9fnEH7IQB1LTk5vUMrzEBcZwBdtA == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudegkedgudeigecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffujghffffkgggtsehgtderredttddtnecuhfhrohhmpeetlhihshhs rgcutfhoshhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpedvue dviedvhefhieektddvvdehgfehffelveeuiefggfdtffffueejudejjeekjeenucfkphep keegrddukeegrddvvdekrddukeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehhihesrghlhihsshgrrdhish X-ME-Proxy: Received: from x220.qyliss.net (p54b8e412.dip0.t-ipconnect.de [84.184.228.18]) by mail.messagingengine.com (Postfix) with ESMTPA id F066C1080064; Wed, 24 Mar 2021 18:42:59 -0400 (EDT) Received: by x220.qyliss.net (Postfix, from userid 1000) id 235DF3AF; Wed, 24 Mar 2021 22:42:58 +0000 (UTC) From: Alyssa Ross To: Adhemerval Zanella Cc: libc-alpha@sourceware.org Subject: Re: [PATCH v4 3/5] Linux: Add close_range In-Reply-To: <20210310152633.3916978-3-adhemerval.zanella@linaro.org> References: <20210310152633.3916978-1-adhemerval.zanella@linaro.org> <20210310152633.3916978-3-adhemerval.zanella@linaro.org> Date: Wed, 24 Mar 2021 22:42:53 +0000 Message-ID: <87r1k4yxzm.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Status: No, score=-14.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_PASS, SPF_PASS 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-List-Received-Date: Wed, 24 Mar 2021 22:43:05 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Adhemerval Zanella via Libc-alpha writes: > diff --git a/manual/llio.texi b/manual/llio.texi > index c0a53e1a6e..c1f54f4a8a 100644 > --- a/manual/llio.texi > +++ b/manual/llio.texi > @@ -284,6 +284,48 @@ of trying to close its underlying file descriptor wi= th @code{close}. > This flushes any buffered output and updates the stream object to > indicate that it is closed. >=20=20 > +@deftypefun int close_range (unsigned int @var{lowfd}, unsigned int @var= {maxfd}, int @var{flags}) > +@standards{Linux, unistd.h} > +@safety{@prelim{}@mtsafe{}@assafe{}@acsafe{@acsfd{}}} > +@c This is a syscall for Linux v5.9. There is no fallback emulation for > +@c older kernels. > + > +The function @code{close_range} closes the file descriptor from @var{low= fd} > +to @var{maxfd} (inclusive). This function is similar to call @code{clos= e} in > +specified file descriptor range depending on the @var{flags}. > + > +This is function is only supportted on recent Linux versions and @thegli= bc{} Typo here: "supportted" > +does not provide any fallback (the application will need to handle possi= ble > +@code{ENOSYS}). > + > +The @var{flags} add options on how the files are closes. Linux currently > +supports: > + > +@vtable @code > +@item CLOSE_RANGE_UNSHARE > +Unshare the file descriptor table before closing file descriptors. > +@end vtable > + > +The normal return value from @code{close_range} is @math{0}; a value > +of @math{-1} is returned in case of failure. The following @code{errno}= error > +conditions are defined for this function: > + > +@table @code > +@item EINVAL > +The @var{lowfd} value is larger than @var{maxfd} or an unsupported @var{= flags} > +is used. > + > +@item ENOMEM > +Either there is not enough memory for the operation, or the process is > +out of address space. > + > +@item EMFILE > +The process has too many files open. > +The maximum number of file descriptors is controlled by the > +@end table > +@end deftypefun > + > + > @node I/O Primitives > @section Input and Output Primitives --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEH9wgcxqlHM/ARR3h+dvtSFmyccAFAmBbwHAACgkQ+dvtSFmy ccBWhxAAiYgVtQ5/JuNNzx/rkGnENe9H+Yo/7roXlkYSPembFKMHUm2BDNVYgowH zwxmSvKlmVwDX+aS1VQTHVEMRSZchE0OPOlO70trckllzOyhjNrEyLgWR7fdRKcK BabkHvB3Fia6prwHprq+LQMsqzL0wy8vxeUR07zg+rwxUGh9vV1H2jbuSU6gCx2N FLv5ToBA6CBee4Wam89paZz36P/g5/+hauFyFqRgH2Xsf9xIQ5owTPpSaHqTY24v QItj4bqhLbPwSUjEtJAIKIl1e4ODjYYqqMU1GSCeHx3w34RzlhzikvnVfC+zUFaj uOlALjlfoktebvfv0Ankwv8JU59MhVNPGq5PPAd/Pyej0Eu9xsMYc7YoBOkAS954 d0i6MG2VGJMYcyex3HFZQHlSiG4xJqvKINA1w8h6q6OY14CkMXyoN5E2A/B+jBUs snhSaAPqSFzXyf+FFJdcEFcDYo4OEABipebsDV6pYXUcU026QYJx1SYc8GYUMudd g90lfIliZ3byR24ePhMJvlFAP8XB+HAAYF584ZkABVyHxyCVnZ0aatL1TQ3nzyAc lZtBanEH+WvddRlYPKA1fXuHuWwaQBN2x6td5m8Qbp15ZfVtxegpwzNsCrZG9TPw yrh2w3dRa6Ojnl3If4cBmmhiCHpmwikr7WhQhC3oVXsK75y4jk8= =mln/ -----END PGP SIGNATURE----- --=-=-=--