From nobody Mon Mar 27 23:39:34 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Plq6G6gmvz42FvD; Mon, 27 Mar 2023 23:39:34 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Plq6G5yHyz43YZ; Mon, 27 Mar 2023 23:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679960374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=stf8yGL+tpjiAta06cHIQAACdHmCHDLWfSfvMnAW3Mo=; b=gM23VVo0rJPmuP1SHd8EdIWQWVn1RWsU4143jsIUTkUKGUxRhEw6WsJaruJ05MTNkvMcfT zowhoA65AAXUbuGRoYdPIAqreQCuJO+02tRjPGhINPXWCXtfRIzAalUYXAC486squTvtVf lK1wuX7i0xK71FrlyD9O6bpyNtXDhcnOFNgGjfHemQYu8Pcd2g0MOudBJsibozcuiYchtt 1xtJ1EaHTtXV9V/hJ6RpzON8IIJ+O3teyu52ScJPqJ9aq+Ut/b+QgeMSkVF0YgtlNIjd9y OQyAKs6MVJBWqbZUrRjv65Xurb+jPv+6JaMAvuX612alBLbvrr8LU/NTW9qPhA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1679960374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=stf8yGL+tpjiAta06cHIQAACdHmCHDLWfSfvMnAW3Mo=; b=HVMT9xP4ZlVSJvfwF9EsjO2PRfMIqSuld4jinkDAzohz8ryqCSP30u5wyOipAGvLGkilAC OmIbn/HYA0Pu5YfEyCXYmB5CdwgZqjodFSo7sv9+uz4hIiwAop/Ae01OwnphRcOylUwyxI 39BfSuyaMTq8tYwVq2vheWioePB28/drXGQHq8hQhrrLiGY0DNfHGPuggybBW2Vu1FTBke sp4XVJzTUHMfyV2AYyEbHku0Qzxur5x7+aN/BKqQrsbP3d3NiBYUXT0UhlsjtKwEc+9zhS 3RR4H4dQjWw1pafy13sDbdVumoAy5mK3YfhSO6eYEQQVXf/7lb1dIOnvv7/vQA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1679960374; a=rsa-sha256; cv=none; b=VtYIaFo/PzgU/clCQ1OC+N+wNX/CAbiyLDmyq+5JScdyUfv6srMe8eI61jRBT/s/Uekq8N lfV47+9hFBzqLS1KCxQHybB5biac6lsUGQCUNozQayjQnYeKx+PqnmuTO8mM0HT0G6cDXF 5wXEt+IwTNJjYcQ61qOF8yzeXvtAD9oIf6tTwgiG+EumcgIOslrcqMksZPWh7UDl9w+hy5 H2R3qkl76Br6l5cXXjmaYf6pk+JjjdmXnEwm3ksuQMrVVtv3DxWllfTsM5i6GSy3tBgZc6 YL/Lfs0k6dP8N+4nMhDUZqnShqYbrhtaFAiYDzXWAokRo/qOKRhLKWtxisUzeA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Plq6G53TPzhhN; Mon, 27 Mar 2023 23:39:34 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 32RNdYgA063715; Mon, 27 Mar 2023 23:39:34 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 32RNdYIx063714; Mon, 27 Mar 2023 23:39:34 GMT (envelope-from git) Date: Mon, 27 Mar 2023 23:39:34 GMT Message-Id: <202303272339.32RNdYIx063714@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: f2ec444be523 - main - kqueue1(2): document List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f2ec444be523d3d00808ff82a7c690c75defe953 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=f2ec444be523d3d00808ff82a7c690c75defe953 commit f2ec444be523d3d00808ff82a7c690c75defe953 Author: Konstantin Belousov AuthorDate: 2023-03-25 23:41:21 +0000 Commit: Konstantin Belousov CommitDate: 2023-03-27 23:39:26 +0000 kqueue1(2): document Reviewed by: emaste, jhb Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D39271 --- lib/libc/sys/Makefile.inc | 1 + lib/libc/sys/kqueue.2 | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc index 45287813fe13..54143b288dc4 100644 --- a/lib/libc/sys/Makefile.inc +++ b/lib/libc/sys/Makefile.inc @@ -430,6 +430,7 @@ MLINKS+=jail.2 jail_attach.2 \ jail.2 jail_set.2 MLINKS+=kldunload.2 kldunloadf.2 MLINKS+=kqueue.2 kevent.2 \ + kqueue.2 kqueue1.2 \ kqueue.2 EV_SET.3 MLINKS+=link.2 linkat.2 MLINKS+=madvise.2 posix_madvise.2 diff --git a/lib/libc/sys/kqueue.2 b/lib/libc/sys/kqueue.2 index c8d39d092b4d..c263fa550244 100644 --- a/lib/libc/sys/kqueue.2 +++ b/lib/libc/sys/kqueue.2 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 14, 2022 +.Dd March 26, 2023 .Dt KQUEUE 2 .Os .Sh NAME @@ -38,6 +38,8 @@ .Ft int .Fn kqueue "void" .Ft int +.Fn kqueue1 "u_int flags" +.Ft int .Fo kevent .Fa "int kq" .Fa "const struct kevent *changelist" @@ -90,6 +92,22 @@ flag, then the descriptor table is shared, which will allow sharing of the kqueue between two processes. .Pp The +.Fn kqueue1 +system call also creates a new kernel event queue, and additionally takes +the +.Fa flags +argument, which is a bitwise-inclusive OR of the following flags: +.Bl -tag -width "KQUEUE_CLOEXEC" +.It Fa KQUEUE_CLOEXEC +The returned file descriptor is automatically closed on +.Xr execve 2 +.El +The +.Ql fd = kqueue() +call is equivalent to +.Ql fd = kqueue1(0) . +.Pp +The .Fn kevent system call is used to register events with the queue, and return any pending