mq on kqueue broken after upgrade to FreeBSD 11
Lewis Donzis
lew at perftech.com
Mon Oct 3 12:29:57 UTC 2016
> On Oct 2, 2016, at 11:37 AM, Konstantin Belousov <kostikbel at gmail.com> wrote:
>
> 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.
>
> 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’s 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
More information about the freebsd-arch
mailing list