mq on kqueue broken after upgrade to FreeBSD 11

Konstantin Belousov kostikbel at gmail.com
Wed Oct 5 13:14:22 UTC 2016


On Mon, Oct 03, 2016 at 07:27:54AM -0500, Lewis Donzis wrote:
> 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.

I really have troubles giving any useful interpretation to your question.
OS provides the kernel service which backs the posix message queue
implementation in userspace, as a file descriptor.  To release resources
designated by the file descriptor, it must be closed, as in, close(2)
must be called.  Librt does this in mq_close(3).

Why should I need to show a case of using close(2) on kernel mq
descriptor (perhaps besides librt) ? And how this changes or augments
the fact that kmq is file descriptor ?


More information about the freebsd-arch mailing list