patch-2.2.13 linux/include/asm-alpha/uaccess.h

Next file: linux/include/asm-i386/pgtable.h
Previous file: linux/fs/qnx4/inode.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.12/linux/include/asm-alpha/uaccess.h linux/include/asm-alpha/uaccess.h
@@ -487,6 +487,15 @@
 	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;
+}
+
 /*
  * About the exception table:
  *

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)