From nobody Thu Dec 18 22:25:19 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dXQGR3fRfz6Lw4T for ; Thu, 18 Dec 2025 22:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dXQGR29lTz3kZ0 for ; Thu, 18 Dec 2025 22:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766096719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ITkdWHmOvgtR7iToiJ5JiOeec6yPzVTjhw6dFxggQSU=; b=kwnYHOF4vebncxI5aV8ltkqf9N1klydZInE5eOuLersq0hR9tfqFIydmUHdSp5clWUuDLZ bCIdlfkF+4FCrRC2fFSYZav9NBtKKmz64H69wwQ9uAd8+E+HV4l1OyOKPwRLMEjSapP6cL ecU+cCChX/fbOEW3vGTDhIlvHjNqAUEjEOmuYsV3/aOhGSE2Lkz34kl5pHNGiNOfuKt/PF y2D6IgACrNxY8G1rmQsgaaKJeOKG0pgPAHoYkoZE5Z01Bg1tHLHiieXBNr+6zt2pCrAliN kzsFdIHsTuw8M92kpvAcE5PLRvzdjc4wAVPbjiH5KeqAAO9e4+jw6vxG39gifw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1766096719; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=ITkdWHmOvgtR7iToiJ5JiOeec6yPzVTjhw6dFxggQSU=; b=ZDQ3rYl97R12VNAv9zlg2gahTxwRizE9sHQlIQmnhCdw4/eDUwx5R3XFn9mFslkgD62XNJ DfX0eqlAc5An2RpVzC9EUSa10QOIvuo2xDSl3A0Pgu+JLEuj7D2OM0TAVWKvY0NL87S1jh 9kXB5IMM8zsr5mI5xkxX18FuWuDEbK66CTxMkB6zXPI80u5s2h84eYznKqpo3A3oq0mkIV hWA/tzz5kqoCl3pHY9KK2WltHP9QpHogymBXRgS4Vv6LpjJEsnFVMC2GN9HdoIF56zXc0G Z7YZgqtojLclznvOA+jz4XU/R5zGNQvBtcGQngIplaCcRy6sicZiCgNVPxTS4g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1766096719; a=rsa-sha256; cv=none; b=OclTIhak9VFo+qPOz6PC4TMVKBvRqLkEcRiR+E35qG6Ua4qo2shb4WDs+mwihqcpiN241n 6nX3XZNL2f0rnnc0I94Qkv2ArlkwKUYwazk12chj9YctZzso2jtKaxtHmyykT34taEIC5g TZrNyEwCnHa1QDbDHt4CPGVGUGOdF5B88nwv/bnvjttWgslDxf0AdzHfI/Wthpmj64RSSU gZ+tvmpjPFTF9rAhYNkFyMIWT9cv7n4mPfhmO+QPf/3rxaHPdxd+5lEAnI9rJ9SHZKyNKB 8knPa1cWay+rM8cI4vc69onWFrZqeV6eg5wlsCx0IFobpV/qiUm2GnTaITIrPw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dXQGR10zdzxHm for ; Thu, 18 Dec 2025 22:25:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 46fab by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Thu, 18 Dec 2025 22:25:19 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Rick Parrish From: Alexander Ziaee Subject: git: ca2413d21619 - main - librt/mq_getfd_np.3: Initial manual page List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: ziaee X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: ca2413d216197fd55f9363d6f65c641ff1aa3ec5 Auto-Submitted: auto-generated Date: Thu, 18 Dec 2025 22:25:19 +0000 Message-Id: <69447f4f.46fab.28f0b01e@gitrepo.freebsd.org> The branch main has been updated by ziaee: URL: https://cgit.FreeBSD.org/src/commit/?id=ca2413d216197fd55f9363d6f65c641ff1aa3ec5 commit ca2413d216197fd55f9363d6f65c641ff1aa3ec5 Author: Rick Parrish AuthorDate: 2025-12-18 22:12:32 +0000 Commit: Alexander Ziaee CommitDate: 2025-12-18 22:19:42 +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 --- 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 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 +.\" +.\" 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 .