man.bsd.lv manual page server

Manual Page Search Parameters

KSTRDUP(9) Kernel Developer's Manual KSTRDUP(9)

kstrdup, kstrndupsave a copy of a string

#include <sys/malloc.h>

char *
kstrdup(const char *str, struct malloc_type *type);

char *
kstrndup(const char *str, size_t maxlen, struct malloc_type *type);

The () function allocates sufficient memory of type type for a copy of the string str, does the copy, and returns a pointer to it. The pointer may subsequently be used as an argument to the function kfree(9).

The () function copies at most maxlen characters from the string str and will always NUL terminate the copied string.

kfree(9), kmalloc(9)

June 5, 2016 DragonFly-5.6.1