Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 3 Mar 2025 16:56:54 GMT
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: a088781bc36d - stable/14 - nv.9: Add a new subsection documenting kernel-specific behavior
Message-ID:  <202503031656.523GusO0083575@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/14 has been updated by jhb:

URL: https://cgit.FreeBSD.org/src/commit/?id=a088781bc36d6a4aba053c3a94f810fec9d9f899

commit a088781bc36d6a4aba053c3a94f810fec9d9f899
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2025-01-03 15:51:51 +0000
Commit:     John Baldwin <jhb@FreeBSD.org>
CommitDate: 2025-03-03 16:56:20 +0000

    nv.9: Add a new subsection documenting kernel-specific behavior
    
    Reviewed by:    emaste
    Sponsored by:   Chelsio Communications
    Differential Revision:  https://reviews.freebsd.org/D48257
    
    (cherry picked from commit ecb5fe3c5e483e09544645ba84281b4a8cba4edf)
---
 share/man/man9/nv.9 | 32 +++++++++++++++++++++++++++++++-
 1 file changed, 31 insertions(+), 1 deletion(-)

diff --git a/share/man/man9/nv.9 b/share/man/man9/nv.9
index 4e4542c146ef..8c99f1d12200 100644
--- a/share/man/man9/nv.9
+++ b/share/man/man9/nv.9
@@ -859,7 +859,7 @@ If no element named
 .Fa name
 with the appropriate type exists, the program aborts.
 The nvlist must not be in the error state.
-.Sh NOTES
+.Ss Notes
 The
 .Fn nvlist_pack
 and
@@ -873,6 +873,36 @@ The
 and
 .Fn nvlist_xfer
 functions can transfer nvlists between hosts with different endianness.
+.Ss Kernel Considerations
+The
+.Nm nv ,
+.Nm cnv ,
+and
+.Nm dnv
+APIs can be used in the kernel with the following differences:
+.Bl -bullet
+.It
+File descriptor and file descriptor array value types are not supported.
+.It
+.Fn nvlist_recv ,
+.Fn nvlist_send ,
+and
+.Fn nvlist_xfer
+are not supported.
+.It
+All memory allocations use the
+.Dv M_NVLIST
+memory type with
+.Xr malloc 9
+and
+.Xr free 9 .
+As a result, any allocated buffers moved into an nvlist must be allocated with
+.Dv M_NVLIST ,
+and buffers returned by functions such as
+.Fn nvlist_pack
+must be freed with
+.Dv M_NVLIST .
+.El
 .Sh EXAMPLES
 The following example demonstrates how to prepare an nvlist and send it over a
 .Xr unix 4



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202503031656.523GusO0083575>