kstrndup(9)

kstrndup9

Allocate space for and copy an existing string

Usage

char * kstrndup(const char * s, size_t max, gfp_t gfp);

Arguments

s

the string to duplicate

max

read at most max chars from s

gfp

the GFP mask used in the kmalloc call when allocating memory

Note

Use kmemdup_nul instead if the size is known exactly.

Releases

2 releases since Debian 8 (Jessie); the text changed 1 time.

  1. 8
  2. 9

From linux-manual-4.9 4.9.228-1 in Debian 9 (Stretch). Parsed by carta from the page's man source.