/* Return 0 on exception, a value greater than N if too long  */
long __strnlen_user(const char __user *s, long n)
/* Return 0 on exception, a value greater than N if too long  */
long __strnlen_user(const char __user *s, long n)
{
	long res = 0;
	char c;
	while (1) {
		if (res>n)
			return n+1;
		if (__get_user(c, s))
			return 0;
		if (!c)
			return res+1;
		res++;
		s++;
	}
}