Page MenuHomeFreeBSD

D60198.id188688.diff
No OneTemporary

D60198.id188688.diff

diff --git a/sys/compat/linuxkpi/common/include/linux/uaccess.h b/sys/compat/linuxkpi/common/include/linux/uaccess.h
--- a/sys/compat/linuxkpi/common/include/linux/uaccess.h
+++ b/sys/compat/linuxkpi/common/include/linux/uaccess.h
@@ -32,6 +32,7 @@
#define _LINUXKPI_LINUX_UACCESS_H_
#include <sys/param.h>
+#include <sys/systm.h>
#include <sys/lock.h>
#include <sys/proc.h>
@@ -119,4 +120,20 @@
#define copy_from_user_inatomic_nontemporal(to, from, n) \
__copy_from_user_inatomic((to), (from), (n))
+static inline long
+strncpy_from_user(char *dst, const char __user *src, long count)
+{
+ size_t done;
+ int error;
+
+ if (count <= 0)
+ return (0);
+ error = copyinstr(src, dst, count, &done);
+ if (error == 0)
+ return ((long)done - 1); /* done includes the NUL */
+ if (error == ENAMETOOLONG)
+ return (count); /* truncated, as Linux */
+ return (-EFAULT);
+}
+
#endif /* _LINUXKPI_LINUX_UACCESS_H_ */

File Metadata

Mime Type
text/plain
Expires
Sat, Oct 10, 8:05 PM (9 h, 26 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40282327
Default Alt Text
D60198.id188688.diff (931 B)

Event Timeline