Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102760899
D31005.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
611 B
Referenced Files
None
Subscribers
None
D31005.diff
View Options
diff --git a/sys/compat/linuxkpi/common/include/linux/string.h b/sys/compat/linuxkpi/common/include/linux/string.h
--- a/sys/compat/linuxkpi/common/include/linux/string.h
+++ b/sys/compat/linuxkpi/common/include/linux/string.h
@@ -167,4 +167,20 @@
return (strncmp(str, prefix, len) == 0 ? len : 0);
}
+static inline ssize_t
+strscpy(char* dst, const char* src, size_t len)
+{
+ size_t i;
+
+ if (len <= INT_MAX) {
+ for (i = 0; i < len; i++)
+ if ('\0' == (dst[i] = src[i]))
+ return ((ssize_t)i);
+ if (i != 0)
+ dst[--i] = '\0';
+ }
+
+ return (-E2BIG);
+}
+
#endif /* _LINUX_STRING_H_ */
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 7:25 PM (21 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14683705
Default Alt Text
D31005.diff (611 B)
Attached To
Mode
D31005: LinuxKPI: Implement strscpy
Attached
Detach File
Event Timeline
Log In to Comment