Page MenuHomeFreeBSD

Manual page for mq_getfd_np(2)
Needs ReviewPublic

Authored by unitrunker_gmail.com on Feb 17 2024, 6:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Jun 5, 4:54 AM
Unknown Object (File)
Mon, Jun 3, 2:15 AM
Unknown Object (File)
Sun, May 19, 4:30 PM
Unknown Object (File)
Thu, May 16, 12:40 AM
Unknown Object (File)
Thu, May 16, 12:25 AM
Unknown Object (File)
Thu, May 16, 12:25 AM
Unknown Object (File)
Wed, May 15, 4:36 PM
Unknown Object (File)
May 12 2024, 2:52 AM

Details

Reviewers
concussious.bugzilla_runbox.com
Group Reviewers
manpages
Summary

mq_getfd_np was made available in FreeBSD 11 with no documentation.

Under the hood - this function dereferences the mqd_t as a pointer to an int.

It's a simple function but needs guidance on what is safe usage for the returned file descriptor.

Please review - particularly the "Notes" section.

Test Plan

Ran the following to confirm behavior.

  • fork followed by fstat in both parent and child process (confirmed mqd_t and fd remain valid).
  • close before mq_close (not a good practice - see "Notes")
  • mq_close before close (also not a good practice - see "Notes")

Test program attached to bug 273230.
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=273230

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

unitrunker_gmail.com edited the summary of this revision. (Show Details)
unitrunker_gmail.com retitled this revision from Manual page for mq_getdf_np(2) to Manual page for mq_getfd_np(2).Feb 17 2024, 6:32 AM
concussious.bugzilla_runbox.com added inline comments.
lib/libsys/mq_getfd_np.2
2

Tried to put this at the very top but it didn't work out.

https://man.freebsd.org/cgi/man.cgi?query=style&apropos=0&sektion=0&manpath=FreeBSD+

43

This doesn't need to be quoted

57

Why a blank line? .Pp?

This revision now requires changes to proceed.Feb 17 2024, 10:00 PM
  • feedback from concussious
  • feedback from pauamma_gundo
  • trimmed some trailing blanks
lib/libsys/mq_getfd_np.2
67
89

I'd like someone who knows about this system call to review this as well.

unitrunker_gmail.com marked 2 inline comments as done.

fix typos caught by pauamma_gundo

kib added inline comments.
lib/libsys/mq_getfd_np.2
38

Was it? The function is non-standard, which part of the text was copied?

55
67

Why this property needs a special mention?

79

New sentence new line. I am not sure that these 'do not call close' are useful. It is better to formulate that the fd is owned by the mq descriptor.

99

otherwise part is weird and most likely should be just omitted.

103

again, 'but may ...' part should be omitted.

114

I do not see a point of listing all mq* functions. Only list functions that are referenced in the body of the man page, and perhaps mqueuefs(5)