diff options
| author | riastradh <riastradh@NetBSD.org> | 2018-08-27 06:49:23 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2018-08-27 06:49:23 +0000 |
| commit | 79e8f4c98df49daa87f308e5d88b4d51ec900fcd (patch) | |
| tree | f7dbed067528c6d27d36fd94eedd013b6d293a97 /sys/external/bsd/drm2/include/linux | |
| parent | d5c38063bc1f9b899e25dfdb145c37908560543f (diff) | |
Add Linux kstrdup.
Diffstat (limited to 'sys/external/bsd/drm2/include/linux')
| -rw-r--r-- | sys/external/bsd/drm2/include/linux/string.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/external/bsd/drm2/include/linux/string.h b/sys/external/bsd/drm2/include/linux/string.h index 235ed0c328f..d9ba6c5afdf 100644 --- a/sys/external/bsd/drm2/include/linux/string.h +++ b/sys/external/bsd/drm2/include/linux/string.h @@ -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 @@ kstrndup(const char *src, size_t maxlen, gfp_t gfp) 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_ */ |
