Date: Thu, 01 Jan 2026 18:05:48 +0000 From: Alexander Ziaee <ziaee@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Cc: Rick Parrish <unitrunker@unitrunker.net> Subject: git: 992f994bb71e - stable/15 - librt/mq_getfd_np.3: Initial manual page Message-ID: <6956b77c.36346.5072db67@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch stable/15 has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=992f994bb71ec61e893457bfc2ffc02dfd8c0b50 commit 992f994bb71ec61e893457bfc2ffc02dfd8c0b50 Author: Rick Parrish <unitrunker@unitrunker.net> AuthorDate: 2025-12-18 22:12:32 +0000 Commit: Alexander Ziaee <ziaee@FreeBSD.org> CommitDate: 2026-01-01 18:05:04 +0000 librt/mq_getfd_np.3: Initial manual page The mq_getfd_np function appeared in FreeBSD 11 with no documentation. This function dereferences the mqd_t as a pointer to an int. Relnotes: yes MFC after: 3 days Reviewed by: kib (previous), markj, ziaee Differential Revision: https://reviews.freebsd.org/D43947 (cherry picked from commit ca2413d216197fd55f9363d6f65c641ff1aa3ec5) --- lib/librt/Makefile | 2 ++ lib/librt/mq_getfd_np.3 | 57 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) diff --git a/lib/librt/Makefile b/lib/librt/Makefile index c755bb123c73..1189636d0416 100644 --- a/lib/librt/Makefile +++ b/lib/librt/Makefile @@ -24,4 +24,6 @@ SYMBOL_MAPS=${.CURDIR}/Symbol.map HAS_TESTS= SUBDIR.${MK_TESTS}+= tests +MAN= mq_getfd_np.3 + .include <bsd.lib.mk> diff --git a/lib/librt/mq_getfd_np.3 b/lib/librt/mq_getfd_np.3 new file mode 100644 index 000000000000..44c29fbdbf73 --- /dev/null +++ b/lib/librt/mq_getfd_np.3 @@ -0,0 +1,57 @@ +.\" +.\" Copyright (c) 2024 Rick Parrish <unitrunker@unitrunker.net> +.\" +.\" SPDX-License-Identifier: BSD-2-Clause +.\" +.Dd December 18, 2025 +.Dt MQ_GETFD_NP 3 +.Os +.Sh NAME +.Nm mq_getfd_np +.Nd get a file descriptor for an open message queue descriptor +.Sh SYNOPSIS +.Lb librt +.In mqueue.h +.Ft int +.Fn mq_getfd_np "mqd_t mqd" +.Sh DESCRIPTION +The +.Nm +function retrieves the underlying file descriptor +from the given message queue descriptor returned from +.Xr mq_open 2 . +The file descriptor is used by other functions +to refer to that message queue. +The +.Fa mqd +argument must be an open message queue descriptor. +.Sh IMPLEMENTATION NOTES +.Fx +implements retrieval or alteration of message queue attributes +based on the file descriptor. +The open file descriptor is copied into a child after +.Xr fork 2 . +The +.Xr fstat 2 , +.Xr fchmod 2 , +and +.Xr fchown 2 +system calls are supported for the file descriptor. +.Pp +The file descriptor is safe to use so long as +the message queue descriptor remains open. +.Sh RETURN VALUES +Upon successful completion, the function returns a file descriptor. +.Sh ERRORS +The +.Nm +function does not return any errors. +.Sh SEE ALSO +.Xr mq_close 2 , +.Xr mq_open 2 , +.Xr mqueuefs 4 +.Sh HISTORY +Support for the +.Nm +function first appeared in +.Fx 11.0 .home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6956b77c.36346.5072db67>
