From owner-svn-src-stable-11@freebsd.org Mon Apr 27 22:43:25 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C4DA2C9121; Mon, 27 Apr 2020 22:43:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49B0DY36j3z3Khc; Mon, 27 Apr 2020 22:43:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 663331A220; Mon, 27 Apr 2020 22:43:25 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03RMhPWo037856; Mon, 27 Apr 2020 22:43:25 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03RMhPuO037855; Mon, 27 Apr 2020 22:43:25 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202004272243.03RMhPuO037855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Mon, 27 Apr 2020 22:43:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r360406 - in stable: 11/lib/libc/sys 12/lib/libc/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/lib/libc/sys 12/lib/libc/sys X-SVN-Commit-Revision: 360406 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2020 22:43:25 -0000 Author: kevans Date: Mon Apr 27 22:43:24 2020 New Revision: 360406 URL: https://svnweb.freebsd.org/changeset/base/360406 Log: MFC r360182-r360183: kqueue(2): add note about EV_RECEIPT r360182: kqueue(2): add a note about EV_RECEIPT In the below-referenced PR, a case is attached of a simple reproducer that exhibits suboptimal behavior: EVFILT_READ and EVFILT_WRITE being set in the same kevent(2) call will only honor the first one. This is, in-fact, how it's supposed to work. A read of the manpage leads me to believe we could be more clear about this; right now there's a logical leap to make in the relevant statement: "When passed as input, it forces EV_ERROR to always be returned." -- the logical leap being that this indicates the caller should have allocated space for the change to be returned with EV_ERROR indicated in the events, or subsequent filters will get dropped on the floor. Another possible workaround that accomplishes similar effect without needing space for all events is just setting EV_RECEIPT on the final change being passed in; if any errored before it, the kqueue would not be drained. If we made it to the final change with EV_RECEIPT set, then we would return that one with EV_ERROR and still not drain the kqueue. This would seem to not be all that advisable. r360183: kqueue(2): de-vandalize the random sentence in the middle A last minute change appears to have inadvertently vandalized unrelated parts of the manpage with the date. =-( PR: 229741 Modified: stable/11/lib/libc/sys/kqueue.2 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/lib/libc/sys/kqueue.2 Directory Properties: stable/12/ (props changed) Modified: stable/11/lib/libc/sys/kqueue.2 ============================================================================== --- stable/11/lib/libc/sys/kqueue.2 Mon Apr 27 22:34:45 2020 (r360405) +++ stable/11/lib/libc/sys/kqueue.2 Mon Apr 27 22:43:24 2020 (r360406) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 27, 2018 +.Dd April 21, 2020 .Dt KQUEUE 2 .Os .Sh NAME @@ -220,6 +220,11 @@ to always be returned. When a filter is successfully added the .Va data field will be zero. +Note that if this flag is encountered and there is no remaining space in +.Fa eventlist +to hold the +.Dv EV_ERROR +event, then subsequent changes will not get processed. .It Dv EV_ONESHOT Causes the event to return only the first occurrence of the filter being triggered.