2 * Copy to/from userspace with optional address space checking.
4 * Copyright 2004-2006 Atmel Corporation
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 #include <linux/errno.h>
13 #include <asm/thread_info.h>
17 * long strncpy_from_user(char *dst, const char *src, long count)
19 * On success, returns the length of the string, not including
20 * the terminating NUL.
22 * If the string is longer than count, returns count
24 * If userspace access fails, returns -EFAULT
28 .global strncpy_from_user
29 .type strncpy_from_user, "function"
32 branch_if_kernel r8, __strncpy_from_user
33 ret_if_privileged r8, r11, r10, r9
35 .global __strncpy_from_user
36 .type __strncpy_from_user, "function"
58 .section __ex_table, "a"