aboutsummaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <[email protected]>2007-07-17 18:37:02 -0700
committerJeremy Fitzhardinge <[email protected]>2007-07-18 08:47:39 -0700
commit1e66df3ee301209f4a38df097d7cc5cb9b367a3f (patch)
tree55beb2a342dbe08c0404f749e02808e3f09023ac /include/linux
parent8b4a40809e5330c9da5d20107d693d92d73b31dc (diff)
add kstrndup
Add a kstrndup function, modelled on strndup. Like strndup this returns a string copied into its own allocated memory, but it copies no more than the specified number of bytes from the source. Remove private strndup() from irda code. Signed-off-by: Jeremy Fitzhardinge <[email protected]> Signed-off-by: Chris Wright <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: YOSHIFUJI Hideaki <[email protected]> Cc: Akinobu Mita <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Al Viro <[email protected]> Cc: Panagiotis Issaris <[email protected]> Cc: Rene Scharfe <[email protected]>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/string.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/string.h b/include/linux/string.h
index 7f2eb6a477f9..ee5e9ccc4aae 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -105,6 +105,7 @@ extern void * memchr(const void *,int,__kernel_size_t);
#endif
extern char *kstrdup(const char *s, gfp_t gfp);
+extern char *kstrndup(const char *s, size_t len, gfp_t gfp);
extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
#ifdef __cplusplus