Bug 273230 - mq_getfd_np needs a man page
Summary: mq_getfd_np needs a man page
Status: New
Alias: None
Product: Documentation
Classification: Unclassified
Component: Manual Pages (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-19 15:50 UTC by Alan Somers
Modified: 2024-02-17 06:24 UTC (History)
3 users (show)

See Also:


Attachments
manual page (3.76 KB, application/x-troff-man)
2024-02-11 23:24 UTC, unitrunker
no flags Details
POC tests to validate a few things state in the proposed doc (964 bytes, application/x-compressed-tar)
2024-02-16 07:54 UTC, unitrunker
no flags Details
manual page (4.05 KB, text/plain)
2024-02-16 09:08 UTC, unitrunker
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Somers freebsd_committer freebsd_triage 2023-08-19 15:50:26 UTC
The mq_getfd_np function was added in ddce1c3ddbfb773c2ee1343721f4e5bbe07186d0 (SVN r306588) in 2016.  However, it's never had a man page.  It needs one.  Especially since mq_open2(2) contains this paragraph, which doesn't make sense if the reader doesn't know about mq_getfd_np:

     FreeBSD implements message queue based on file descriptor.  The
     descriptor is inherited by child after fork(2).  The descriptor is closed
     in a new image after exec(3).  The select(2) and kevent(2) system calls
     are supported for message queue descriptor.
Comment 1 unitrunker 2024-02-07 06:20:04 UTC
This function allows retrieving and setting group, user and mode bits on a POSIX message queue without mounting mqueuefs (the module must be loaded but need not be mounted).

One key question is what one must do with the descriptor when done with the associated mqd_t handle. Should the fd be closed explicitly or does mq_close take care of that?
Comment 2 unitrunker 2024-02-11 23:24:02 UTC
Created attachment 248374 [details]
manual page

Early draft for man page.

Writing some code to verify what is claimed is actually true.
Comment 3 Cy Schubert freebsd_committer freebsd_triage 2024-02-15 19:07:26 UTC
(In reply to unitrunker from comment #2)

Probably a good idea to create a phabricator review and set doc committers to review. They will be able to commit too.
Comment 4 unitrunker 2024-02-16 07:54:31 UTC
Created attachment 248500 [details]
POC tests to validate a few things state in the proposed doc

Covers close before mq_close and mq_close before close. Also covers fork.
Comment 5 unitrunker 2024-02-16 09:08:44 UTC
Created attachment 248501 [details]
manual page

Updated and clarified some points in the document.
Comment 6 unitrunker 2024-02-17 06:24:47 UTC
(In reply to Cy Schubert from comment #3)
https://reviews.freebsd.org/D43947

Adding reviewers now.