Document kmem_strdup() and kmem_strndup()
Added in 2018 by christos@ in sys/sys/kmem.h r. 1.11.
This commit is contained in:
parent
e830eb67a9
commit
460ab12717
@ -1,4 +1,4 @@
|
||||
.\" $NetBSD: kmem.9,v 1.24 2019/08/15 12:24:08 maxv Exp $
|
||||
.\" $NetBSD: kmem.9,v 1.25 2020/06/18 23:30:51 kamil Exp $
|
||||
.\"
|
||||
.\" Copyright (c)2006 YAMAMOTO Takashi,
|
||||
.\" All rights reserved.
|
||||
@ -25,7 +25,7 @@
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.\" ------------------------------------------------------------
|
||||
.Dd August 15, 2019
|
||||
.Dd June 19, 2020
|
||||
.Dt KMEM 9
|
||||
.Os
|
||||
.\" ------------------------------------------------------------
|
||||
@ -63,6 +63,12 @@
|
||||
.Ft char *
|
||||
.Fn kmem_strdupsize \
|
||||
"const char *str" "size_t *size" "km_flag_t kmflags"
|
||||
.Ft char *
|
||||
.Fn kmem_strdup \
|
||||
"const char *str" "km_flag_t kmflags"
|
||||
.Ft char *
|
||||
.Fn kmem_strndup \
|
||||
"const char *str" "size_t manxlen" "km_flag_t kmflags"
|
||||
.Ft void
|
||||
.Fn kmem_strfree \
|
||||
"char *str"
|
||||
@ -184,6 +190,22 @@ argument if that is not
|
||||
.Dv NULL .
|
||||
.Pp
|
||||
The
|
||||
.Fn kmem_strdup
|
||||
function is a simplified version of
|
||||
.Fn kmem_strdupsize
|
||||
that does not return the size of the allocation.
|
||||
.Pp
|
||||
The
|
||||
.Fn kmem_strndup
|
||||
function is variation of
|
||||
.Fn kmem_strdup
|
||||
that copies at most
|
||||
.Fa maxlen
|
||||
characters from the string
|
||||
.Fa str
|
||||
always NUL terminating the copied string.
|
||||
.Pp
|
||||
The
|
||||
.Fn kmem_strfree
|
||||
function can be used to free a
|
||||
.Dv NUL
|
||||
|
Loading…
Reference in New Issue
Block a user