Update of /cvsroot/linux-vax/kernel-2.4/include/asm-vax
In directory usw-pr-cvs1:/tmp/cvs-serv30243
Modified Files:
uaccess.h
Log Message:
Declarations for strlen_user and strnlen_user
Index: uaccess.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/include/asm-vax/uaccess.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- uaccess.h 2001/01/17 16:18:52 1.1
+++ uaccess.h 2001/02/05 00:09:31 1.2
@@ -261,8 +261,20 @@
*
* Return 0 for error
*/
+extern long __strlen_user(const char *);
-extern long strlen_user(const char *);
+extern inline long strlen_user(const char *str)
+{
+ return access_ok(VERIFY_READ,str,0) ? __strlen_user(str) : 0;
+}
+
+/* Returns: 0 if exception before NUL or reaching the supplied limit (N),
+ * a value greater than N if the limit would be exceeded, else strlen. */
+extern long __strnlen_user(const char *, long);
+extern inline long strnlen_user(const char *str, long n)
+{
+ return access_ok(VERIFY_READ,str,0) ? __strnlen_user(str, n) : 0;
+}
#endif /* __ASSEMBLY__ */
|