summaryrefslogtreecommitdiff
path: root/backport-include/linux/string.h
diff options
context:
space:
mode:
Diffstat (limited to 'backport-include/linux/string.h')
-rw-r--r--backport-include/linux/string.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/backport-include/linux/string.h b/backport-include/linux/string.h
new file mode 100644
index 0000000..b85d9c7
--- /dev/null
+++ b/backport-include/linux/string.h
@@ -0,0 +1,32 @@
+#ifndef __BACKPORT_LINUX_STRING_H
+#define __BACKPORT_LINUX_STRING_H
+#include_next <linux/string.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_IS_LESS(4,5,0)
+#define memdup_user_nul LINUX_BACKPORT(memdup_user_nul)
+extern void *memdup_user_nul(const void __user *, size_t);
+#endif
+
+/* this was added in v3.2.65, v3.4.106, v3.10.60, v3.12.33, v3.14.24,
+ * v3.17.3 and v3.18 */
+#if !(LINUX_VERSION_IS_GEQ(3,17,3) || \
+ (LINUX_VERSION_IS_GEQ(3,14,24) && \
+ LINUX_VERSION_IS_LESS(3,15,0)) || \
+ (LINUX_VERSION_IS_GEQ(3,12,33) && \
+ LINUX_VERSION_IS_LESS(3,13,0)) || \
+ (LINUX_VERSION_IS_GEQ(3,10,60) && \
+ LINUX_VERSION_IS_LESS(3,11,0)) || \
+ (LINUX_VERSION_IS_GEQ(3,4,106) && \
+ LINUX_VERSION_IS_LESS(3,5,0)) || \
+ (LINUX_VERSION_IS_GEQ(3,2,65) && \
+ LINUX_VERSION_IS_LESS(3,3,0)))
+#define memzero_explicit LINUX_BACKPORT(memzero_explicit)
+void memzero_explicit(void *s, size_t count);
+#endif
+
+#if LINUX_VERSION_IS_LESS(4,3,0)
+ssize_t strscpy(char *dest, const char *src, size_t count);
+#endif
+
+#endif /* __BACKPORT_LINUX_STRING_H */