1__STRNCPY_FROM_USER(9) Memory Management in Linux __STRNCPY_FROM_USER(9)
2
3
4
6 __strncpy_from_user - Copy a NUL terminated string from userspace, with
7 less checking.
8
10 long __strncpy_from_user(char * dst, const char __user * src,
11 long count);
12
14 dst
15 Destination address, in kernel space. This buffer must be at least
16 count bytes long.
17
18 src
19 Source address, in user space.
20
21 count
22 Maximum number of bytes to copy, including the trailing NUL.
23
25 Copies a NUL-terminated string from userspace to kernel space. Caller
26 must check the specified block with access_ok before calling this
27 function.
28
29 On success, returns the length of the string (not including the
30 trailing NUL).
31
32 If access to userspace fails, returns -EFAULT (some data may have been
33 copied).
34
35 If count is smaller than the length of the string, copies count bytes
36 and returns count.
37
39Kernel Hackers Manual 2.6. June 2019 __STRNCPY_FROM_USER(9)