Source-Changes-HG archive

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

[src/trunk]: src/sys/external/bsd/drm2/include/linux Add Linux kstrdup.



details:   https://anonhg.NetBSD.org/src/rev/5feedea586f0
branches:  trunk
changeset: 365806:5feedea586f0
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Mon Aug 27 06:49:23 2018 +0000

description:
Add Linux kstrdup.

diffstat:

 sys/external/bsd/drm2/include/linux/string.h |  11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diffs (23 lines):

diff -r bae27f8127cc -r 5feedea586f0 sys/external/bsd/drm2/include/linux/string.h
--- a/sys/external/bsd/drm2/include/linux/string.h      Mon Aug 27 06:49:12 2018 +0000
+++ b/sys/external/bsd/drm2/include/linux/string.h      Mon Aug 27 06:49:23 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: string.h,v 1.4 2015/02/25 14:55:57 riastradh Exp $     */
+/*     $NetBSD: string.h,v 1.5 2018/08/27 06:49:23 riastradh Exp $     */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -84,4 +84,13 @@
        return dst;
 }
 
+static inline char *
+kstrdup(const char *src, gfp_t gfp)
+{
+
+       if (src == NULL)
+               return NULL;
+       return kstrndup(src, strlen(src), gfp);
+}
+
 #endif  /* _LINUX_STRING_H_ */



Home | Main Index | Thread Index | Old Index