1__COPY_FROM_USER(9)       Memory Management in Linux       __COPY_FROM_USER(9)
2
3
4

NAME

6       __copy_from_user - Copy a block of data from user space, with less
7       checking.
8

SYNOPSIS

10       unsigned long __copy_from_user(void * to, const void __user * from,
11                                      unsigned long n);
12

ARGUMENTS

14       to
15           Destination address, in kernel space.
16
17       from
18           Source address, in user space.
19
20       n
21           Number of bytes to copy.
22

CONTEXT

24       User context only. This function may sleep.
25

DESCRIPTION

27       Copy data from user space to kernel space. Caller must check the
28       specified block with access_ok before calling this function.
29
30       Returns number of bytes that could not be copied. On success, this will
31       be zero.
32
33       If some data could not be copied, this function will pad the copied
34       data to the requested size using zero bytes.
35
36       An alternate version - __copy_from_user_inatomic - may be called from
37       atomic context and will fail rather than sleep. In this case the
38       uncopied bytes will *NOT* be padded with zeros. See fs/filemap.h for
39       explanation of why this is needed.
40
42Kernel Hackers Manual 3.10         June 2019               __COPY_FROM_USER(9)
Impressum