Linux Kernel
3.7.1
|
#include <linux/errno.h>
#include <linux/sched.h>
Go to the source code of this file.
Data Structures | |
struct | mm_segment_t |
struct | exception_table_entry |
Functions | |
__kernel_size_t | __copy_user (void *to, const void *from, __kernel_size_t n) |
__kernel_size_t | copy_to_user (void __user *to, const void *from, __kernel_size_t n) |
__kernel_size_t | copy_from_user (void *to, const void __user *from, __kernel_size_t n) |
int | __get_user_bad (void) |
int | __put_user_bad (void) |
__kernel_size_t | clear_user (void __user *addr, __kernel_size_t size) |
__kernel_size_t | __clear_user (void __user *addr, __kernel_size_t size) |
long | strncpy_from_user (char *dst, const char __user *src, long count) |
long | __strncpy_from_user (char *dst, const char __user *src, long count) |
long | strnlen_user (const char __user *__s, long __n) |
long | __strnlen_user (const char __user *__s, long __n) |
#define __copy_from_user_inatomic __copy_from_user |
#define __copy_to_user_inatomic __copy_to_user |
#define __get_user | ( | x, | |
ptr | |||
) | __get_user_nocheck((x),(ptr),sizeof(*(ptr))) |
#define __get_user_asm | ( | suffix, | |
__gu_val, | |||
ptr, | |||
__gu_err | |||
) |
#define __put_user_asm | ( | suffix, | |
ptr, | |||
__pu_val, | |||
__gu_err | |||
) |
#define KERNEL_DS MAKE_MM_SEG(0) |
#define MAKE_MM_SEG | ( | s | ) | ((mm_segment_t) { (s) }) |
#define strlen_user | ( | s | ) | strnlen_user(s, ~0UL >> 1) |
#define USER_DS MAKE_MM_SEG(1) |
__kernel_size_t __clear_user | ( | void __user * | addr, |
unsigned long | size | ||
) |
__clear_user: - Zero a block of memory in user space, with less checking. : Destination address, in user space.
: Number of bytes to zero.
Zero a block of memory in user space. Caller must check the specified block with access_ok() before calling this function.
Returns number of bytes that could not be cleared. On success, this will be zero.
Definition at line 158 of file uaccess_with_memcpy.c.
__kernel_size_t __copy_user | ( | void * | to, |
const void * | from, | ||
__kernel_size_t | n | ||
) |
Definition at line 113 of file usercopy.c.
__kernel_size_t clear_user | ( | void __user * | to, |
unsigned long | n | ||
) |
clear_user: - Zero a block of memory in user space. : Destination address, in user space.
: Number of bytes to zero.
Zero a block of memory in user space.
Returns number of bytes that could not be cleared. On success, this will be zero.
Definition at line 224 of file usercopy.c.
__kernel_size_t copy_from_user | ( | void * | to, |
const void __user * | from, | ||
__kernel_size_t | n | ||
) |
Definition at line 12 of file usercopy_64.c.
copy_to_user: - Copy a block of data into user space. : Destination address, in user space. : Source address, in kernel space.
: Number of bytes to copy.
Context: User context only. This function may sleep.
Copy data from kernel space to user space.
Returns number of bytes that could not be copied. On success, this will be zero.
Definition at line 21 of file usercopy_64.c.
strncpy_from_user: - Copy a NUL terminated string from userspace. : Destination address, in kernel space. This buffer must be at least bytes long. : Source address, in user space. : Maximum number of bytes to copy, including the trailing NUL.
Copies a NUL-terminated string from userspace to kernel space.
On success, returns the length of the string (not including the trailing NUL).
If access to userspace fails, returns -EFAULT (some data may have been copied).
If is smaller than the length of the string, copies bytes and returns .
strnlen_user: - Get the size of a user string INCLUDING final NUL. : The string to measure. : Maximum count (including NUL character)
Context: User context only. This function may sleep.
Get the size of a NUL-terminated string in user space.
Returns the size of the string INCLUDING the terminating NUL. If the string is too long, returns 'count+1'. On exception (or invalid count), returns 0.