diff options
Diffstat (limited to 'arch/alpha/include/asm/uaccess.h')
-rw-r--r-- | arch/alpha/include/asm/uaccess.h | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/arch/alpha/include/asm/uaccess.h b/arch/alpha/include/asm/uaccess.h index b49ec2f8d6e3..766fdfde2b7a 100644 --- a/arch/alpha/include/asm/uaccess.h +++ b/arch/alpha/include/asm/uaccess.h | |||
@@ -433,36 +433,12 @@ clear_user(void __user *to, long len) | |||
433 | #undef __module_address | 433 | #undef __module_address |
434 | #undef __module_call | 434 | #undef __module_call |
435 | 435 | ||
436 | /* Returns: -EFAULT if exception before terminator, N if the entire | 436 | #define user_addr_max() \ |
437 | buffer filled, else strlen. */ | 437 | (segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL) |
438 | 438 | ||
439 | extern long __strncpy_from_user(char *__to, const char __user *__from, long __to_len); | 439 | extern long strncpy_from_user(char *dest, const char __user *src, long count); |
440 | 440 | extern __must_check long strlen_user(const char __user *str); | |
441 | extern inline long | 441 | extern __must_check long strnlen_user(const char __user *str, long n); |
442 | strncpy_from_user(char *to, const char __user *from, long n) | ||
443 | { | ||
444 | long ret = -EFAULT; | ||
445 | if (__access_ok((unsigned long)from, 0, get_fs())) | ||
446 | ret = __strncpy_from_user(to, from, n); | ||
447 | return ret; | ||
448 | } | ||
449 | |||
450 | /* Returns: 0 if bad, string length+1 (memory size) of string if ok */ | ||
451 | extern long __strlen_user(const char __user *); | ||
452 | |||
453 | extern inline long strlen_user(const char __user *str) | ||
454 | { | ||
455 | return access_ok(VERIFY_READ,str,0) ? __strlen_user(str) : 0; | ||
456 | } | ||
457 | |||
458 | /* Returns: 0 if exception before NUL or reaching the supplied limit (N), | ||
459 | * a value greater than N if the limit would be exceeded, else strlen. */ | ||
460 | extern long __strnlen_user(const char __user *, long); | ||
461 | |||
462 | extern inline long strnlen_user(const char __user *str, long n) | ||
463 | { | ||
464 | return access_ok(VERIFY_READ,str,0) ? __strnlen_user(str, n) : 0; | ||
465 | } | ||
466 | 442 | ||
467 | /* | 443 | /* |
468 | * About the exception table: | 444 | * About the exception table: |