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

Next file: linux/include/asm-sparc64/ipc.h
Previous file: linux/include/asm-sparc/openpromio.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.12/linux/include/asm-sparc/uaccess.h linux/include/asm-sparc/uaccess.h
@@ -1,4 +1,4 @@
-/* $Id: uaccess.h,v 1.18 1999/03/30 06:38:38 jj Exp $
+/* $Id: uaccess.h,v 1.18.2.1 1999/09/10 09:54:34 davem Exp $
  * uaccess.h: User space memore access functions.
  *
  * Copyright (C) 1996 David S. Miller (davem@caip.rutgers.edu)
@@ -384,6 +384,7 @@
 } __sfu_res; })
 
 extern int __strlen_user(const char *);
+extern int __strnlen_user(const char *, long len);
 
 extern __inline__ int strlen_user(const char *str)
 {
@@ -391,6 +392,14 @@
 		return 0;
 	else
 		return __strlen_user(str);
+}
+
+extern __inline__ int strnlen_user(const char *str, long len)
+{
+	if(!access_ok(VERIFY_READ, str, 0))
+		return 0;
+	else
+		return __strnlen_user(str, len);
 }
 
 #endif  /* __ASSEMBLY__ */

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