From owner-freebsd-arch@freebsd.org Mon Oct 3 12:29:57 2016 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5CEB7AF36F8 for ; Mon, 3 Oct 2016 12:29:57 +0000 (UTC) (envelope-from lew@perftech.com) Received: from smtp-gw.pt.net (smtp-gw.pt.net [206.210.194.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "smtp-gw.pt.net", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 28E102EA for ; Mon, 3 Oct 2016 12:29:56 +0000 (UTC) (envelope-from lew@perftech.com) X-ASG-Debug-ID: 1475497675-09411a12bf11aec80001-RYubVt Received: from mail.pt.net (mail.pt.net [206.210.194.11]) by smtp-gw.pt.net with ESMTP id bsSvpowZ76zdXsJo (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Mon, 03 Oct 2016 07:27:55 -0500 (CDT) X-Barracuda-Envelope-From: lew@perftech.com X-Barracuda-Effective-Source-IP: mail.pt.net[206.210.194.11] X-Barracuda-Apparent-Source-IP: 206.210.194.11 Received: from localhost (localhost [IPv6:::1]) by mail.pt.net (Postfix) with ESMTP id AFD3C842601; Mon, 3 Oct 2016 07:27:55 -0500 (CDT) Received: from mail.pt.net ([IPv6:::1]) by localhost (mail.pt.net [IPv6:::1]) (amavisd-new, port 10032) with ESMTP id E2UtlsqCnUjj; Mon, 3 Oct 2016 07:27:55 -0500 (CDT) Received: from localhost (localhost [IPv6:::1]) by mail.pt.net (Postfix) with ESMTP id 7ECC28425F8; Mon, 3 Oct 2016 07:27:55 -0500 (CDT) X-Virus-Scanned: amavisd-new at pt.net Received: from mail.pt.net ([IPv6:::1]) by localhost (mail.pt.net [IPv6:::1]) (amavisd-new, port 10026) with ESMTP id p5kxVXxakSbk; Mon, 3 Oct 2016 07:27:55 -0500 (CDT) Received: from lewhome-dhcp-179.pt.net (lewhome-dhcp-179.pt.net [206.210.207.179]) (Authenticated sender: lew@pt.net) by mail.pt.net (Postfix) with ESMTPSA id 2BB838425E3; Mon, 3 Oct 2016 07:27:55 -0500 (CDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 9.3 \(3124\)) Subject: Re: mq on kqueue broken after upgrade to FreeBSD 11 From: Lewis Donzis X-ASG-Orig-Subj: Re: mq on kqueue broken after upgrade to FreeBSD 11 In-Reply-To: <20161002163708.GG38409@kib.kiev.ua> Date: Mon, 3 Oct 2016 07:27:54 -0500 Cc: Jilles Tjoelker , deischen@freebsd.org, freebsd-arch@freebsd.org Content-Transfer-Encoding: quoted-printable Message-Id: <95CA96C0-A0F2-46B6-8BEA-E1A923FEC91D@perftech.com> References: <19A6EEAA-C68E-4DAD-B98F-4D904734BD8B@perftech.com> <20160930152006.GS38409@kib.kiev.ua> <20160930184418.1047afc2@kan> <20161001092515.GW38409@kib.kiev.ua> <20161001201655.GA91457@stack.nl> <20161001210722.GC38409@kib.kiev.ua> <20161001231524.GB91457@stack.nl> <20161002114613.GE38409@kib.kiev.ua> <20161002132242.GA2628@stack.nl> <7A72D37B-6C57-41FE-893F-592235A19D9D@perftech.com> <20161002163708.GG38409@kib.kiev.ua> To: Konstantin Belousov X-Mailer: Apple Mail (2.3124) X-Barracuda-Connect: mail.pt.net[206.210.194.11] X-Barracuda-Start-Time: 1475497675 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://smtp-gw.pt.net:443/cgi-mod/mark.cgi X-Barracuda-Scan-Msg-Size: 1058 X-Virus-Scanned: by bsmtpd at pt.net X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests=BSF_SC0_MISMATCH_TO X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.33427 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC0_MISMATCH_TO Envelope rcpt doesn't match header X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2016 12:29:57 -0000 > On Oct 2, 2016, at 11:37 AM, Konstantin Belousov = wrote: >=20 > On Sun, Oct 02, 2016 at 09:11:12AM -0500, Lewis Donzis wrote: >> Technically, neither are mqueues. The only thing "the int" can be = used for is select(), poll(), and kevent(). You can???t (or at least = shouldn???t) pass it to any of the other system calls that accept fds. >=20 > Technically, mqueues are file descriptors. FWIW, allowed operations = (in > the sense of doing something instead of returning errors) are, besides > polling, also stat, chmod, chown. They are enumerable as normal = elements > of the process' file descriptor table, inherited on fork, and you can > and should close(2) them. That's a very good point, I hadn't considered those other functions, and = it=E2=80=99s clear that an fd is allocated and stored in the mqd_t. But = using close() instead of mq_close() wouldn't delete the sigevent or free = the memory that was allocated by mq_open(). In other words, I don't = understand why you'd ever want/need to use close() on the underlying fd. lew=