From nobody Sun Oct 16 13:36:41 2022 X-Original-To: freebsd-hackers@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 4Mr1Pf4TsYz4fFCZ for ; Sun, 16 Oct 2022 13:36:54 +0000 (UTC) (envelope-from yaroslaw.mashko@gmail.com) Received: from mail-vs1-xe2b.google.com (mail-vs1-xe2b.google.com [IPv6:2607:f8b0:4864:20::e2b]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Mr1Pd5lLKz3MVm for ; Sun, 16 Oct 2022 13:36:53 +0000 (UTC) (envelope-from yaroslaw.mashko@gmail.com) Received: by mail-vs1-xe2b.google.com with SMTP id d187so9175707vsd.6 for ; Sun, 16 Oct 2022 06:36:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=7abSjix+Gzz79mvI4F/ZfylecfXmrw3RgN626aoGI6I=; b=IOvuKtGAZflpyD+GYAKHuv32xrozJLgM7uDeVPqOLp4aeXpBUeS683WyL3X6tFpL/1 /hqgJ6mFKxDlToVmOh9wJwiDyFkoHuw4oKAhIvno6INb68ItW9WgD86ruzUp8WCBFPda ANKxWVuQ6rUGggSnDXJ0XSc2qbIT4kMBbsfbjPeqlIlX84RU6t1W/RGL828TLvoqf1jT 4ANdGzbdlyONPU7OZvaatUh8bMFVNPVRQU8uwRk2y/CFkM1lafQUCnYRQN+SIUIYxSi/ mQW+hvL+XrinQEOEdnwrnxdr9qEN2ACE6p8RWjX279m1MMRf9Ha1tqtEh8k9mzM0tkoG Vxtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=7abSjix+Gzz79mvI4F/ZfylecfXmrw3RgN626aoGI6I=; b=TVKSo/DfX9/7eWxLGibRf9c5LiMcjj+Nc0A7m1lnPU+PxQ0mRb3MGIVBWjgM6Wws9q TEKBDnaMkFv1AQeF5KUwD7LM7ubR8M4AL+h+jzoDZV7P6nyZdgOgCnR4qxMSE2XL4LwA anoyZkX+Nv2ZypAZCLWmUeR58qT6GHYWBkv4h0T/QQYoCR/sv2HSrExDDyW0GQT7QnhV bLa/jgw2bGPRj+24sxr4LTnWcJVxHiSuaoAaMBp/Hwh8TgqRP3DSijIrYrNMDSUbasjw SZLPhrASv5hNA4DGB9tELxwFQRPqDz5qph2j5GeauGxlhDQtM8xxRnMBDpVfl1mte5Sn yvfg== X-Gm-Message-State: ACrzQf1gbphXXbRrjSUyVw2TovZBdhz8OMXKeSRKcoRhVt5dUy3KNwtc JGWBycqAJVJfe2LEryIEv2iQ6ibAaOx3d2k/FDZWQA9Wa4c= X-Google-Smtp-Source: AMsMyM5lZHdS83qhg0CmjtdLK8vermX8eMIhoA71oaKPwsy5o1DH7e5mgsjCnMHHi5r39yDHeUy8mWCxGk5AkantK6o= X-Received: by 2002:a05:6102:7c9:b0:3a7:6261:935 with SMTP id y9-20020a05610207c900b003a762610935mr2577810vsg.73.1665927412953; Sun, 16 Oct 2022 06:36:52 -0700 (PDT) List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@freebsd.org MIME-Version: 1.0 From: =?UTF-8?B?0K/RgNC+0YHQu9Cw0LIg0JzQsNGI0LrQvg==?= Date: Sun, 16 Oct 2022 16:36:41 +0300 Message-ID: Subject: I want some clarification on kqueue, EV_CLEAR flag To: freebsd-hackers@freebsd.org Content-Type: multipart/alternative; boundary="000000000000abb49a05eb26f393" X-Rspamd-Queue-Id: 4Mr1Pd5lLKz3MVm X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=IOvuKtGA; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of yaroslaw.mashko@gmail.com designates 2607:f8b0:4864:20::e2b as permitted sender) smtp.mailfrom=yaroslaw.mashko@gmail.com X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999]; NEURAL_HAM_LONG(-1.00)[-0.998]; NEURAL_HAM_SHORT(-1.00)[-0.997]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; RCPT_COUNT_ONE(0.00)[1]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::e2b:from]; ARC_NA(0.00)[]; TAGGED_FROM(0.00)[]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; DKIM_TRACE(0.00)[gmail.com:+]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_NONE(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; FREEMAIL_ENVFROM(0.00)[gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-ThisMailContainsUnwantedMimeParts: N --000000000000abb49a05eb26f393 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hello, I learn how to manage events with a kqueue. I did some research and have a confusion with EV_CLEAR and EV_DISPATCH flags. So this message contains two questions. 1. I see that EV_DISPATCH flag stays with event no matter what steps do I take. The EV_ADD | EV_ENABLE leaves the EV_DISPATCH flag in. There seem that the only way to switch off EV_DISPATCH is to delete event completely. Is it the case? 2. I was confused after a look at the man pages for kqueue. EV_CLEAR section tells that the state gets reset. My thought were that EV_DISPATCH gets switched off. After that, I did read the /src/sys/kern/kern_event.c source file. The only state that I had found changed is data plus fflags fields. The was a confusing bit of manual. --=20 =D0=AF=D1=80=D0=BE=D1=81=D0=BB=D0=B0=D0=B2 =D0=9C=D0=B0=D1=88=D0=BA=D0=BE +380 50 56 75 347 <+380+50+56+75+347> --000000000000abb49a05eb26f393 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hello,

I learn how to manage= events with a kqueue. I did some research and have a confusion with EV_CLE= AR and EV_DISPATCH flags.

So this message contains= two questions.

1. I see that EV_DISPATCH flag sta= ys with event no matter what steps do I take. The EV_ADD | EV_ENABLE leaves= the EV_DISPATCH flag in.
There seem that the only way to switch = off EV_DISPATCH is to delete event completely. Is it the case?
2. I was confused after a look at the man pages for kqueue. EV= _CLEAR section tells that the state gets reset. My thought were that EV_DIS= PATCH gets switched off. After that, I did read the /src/sys/kern/kern_even= t.c source file. The only state that I had found changed is data plus fflag= s fields. The was a confusing bit of manual.

--
<= div dir=3D"ltr">
=D0=AF= =D1=80=D0=BE=D1=81=D0=BB=D0=B0=D0=B2 =D0=9C=D0=B0=D1=88=D0=BA=D0=BE

--000000000000abb49a05eb26f393--