Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/share/man/man9 Document kmem_strdup() and kmem_strndup()



details:   https://anonhg.NetBSD.org/src/rev/cb698cb8a67d
branches:  trunk
changeset: 1011108:cb698cb8a67d
user:      kamil <kamil%NetBSD.org@localhost>
date:      Thu Jun 18 23:30:51 2020 +0000

description:
Document kmem_strdup() and kmem_strndup()

Added in 2018 by christos@ in sys/sys/kmem.h r. 1.11.

diffstat:

 share/man/man9/kmem.9 |  26 ++++++++++++++++++++++++--
 1 files changed, 24 insertions(+), 2 deletions(-)

diffs (54 lines):

diff -r f605e445ae9a -r cb698cb8a67d share/man/man9/kmem.9
--- a/share/man/man9/kmem.9     Thu Jun 18 20:38:42 2020 +0000
+++ b/share/man/man9/kmem.9     Thu Jun 18 23:30:51 2020 +0000
@@ -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 @@
 .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



Home | Main Index | Thread Index | Old Index