Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Oct 2016 07:27:54 -0500
From:      Lewis Donzis <lew@perftech.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Jilles Tjoelker <jilles@stack.nl>, deischen@freebsd.org, freebsd-arch@freebsd.org
Subject:   Re: mq on kqueue broken after upgrade to FreeBSD 11  
Message-ID:  <95CA96C0-A0F2-46B6-8BEA-E1A923FEC91D@perftech.com>
In-Reply-To: <20161002163708.GG38409@kib.kiev.ua>
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>

next in thread | previous in thread | raw e-mail | index | archive | help

> On Oct 2, 2016, at 11:37 AM, Konstantin Belousov <kostikbel@gmail.com> =
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=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?95CA96C0-A0F2-46B6-8BEA-E1A923FEC91D>