aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/string.h
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@xensource.com>2007-07-17 18:37:02 -0700
committerJeremy Fitzhardinge <jeremy@goop.org>2007-07-18 08:47:39 -0700
commit1e66df3ee301209f4a38df097d7cc5cb9b367a3f (patch)
tree55beb2a342dbe08c0404f749e02808e3f09023ac /include/linux/string.h
parent8b4a40809e5330c9da5d20107d693d92d73b31dc (diff)
downloadkernel_samsung_smdk4412-1e66df3ee301209f4a38df097d7cc5cb9b367a3f.zip
kernel_samsung_smdk4412-1e66df3ee301209f4a38df097d7cc5cb9b367a3f.tar.gz
kernel_samsung_smdk4412-1e66df3ee301209f4a38df097d7cc5cb9b367a3f.tar.bz2
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 <jeremy@xensource.com> Signed-off-by: Chris Wright <chrisw@sous-sol.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Randy Dunlap <randy.dunlap@oracle.com> Cc: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Cc: Akinobu Mita <akinobu.mita@gmail.com> Cc: Arnaldo Carvalho de Melo <acme@mandriva.com> Cc: Al Viro <viro@ftp.linux.org.uk> Cc: Panagiotis Issaris <takis@issaris.org> Cc: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Diffstat (limited to 'include/linux/string.h')
-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 7f2eb6a..ee5e9cc 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