Linux Kernel
3.7.1
|
#include <linux/string.h>
#include <linux/thread_info.h>
#include <asm/errno.h>
#include <asm/memory.h>
#include <asm/domain.h>
#include <asm/unified.h>
#include <asm/compiler.h>
Go to the source code of this file.
Data Structures | |
struct | exception_table_entry |
Functions | |
int | fixup_exception (struct pt_regs *regs) |
int | __get_user_bad (void) |
int | __put_user_bad (void) |
long | strncpy_from_user (char *dest, const char __user *src, long count) |
__must_check long | strlen_user (const char __user *str) |
__must_check long | strnlen_user (const char __user *str, long n) |
#define __copy_from_user_inatomic __copy_from_user |
#define __copy_to_user_inatomic __copy_to_user |
#define __get_user | ( | x, | |
ptr | |||
) |
#define user_addr_max | ( | ) | (segment_eq(get_fs(), USER_DS) ? TASK_SIZE : ~0UL) |
__must_check long strlen_user | ( | const char __user * | str | ) |
strlen_user: - Get the size of a user string INCLUDING final NUL. : The string to measure.
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. On exception, returns 0.
If there is a limit on the length of a valid string, you may wish to consider using strnlen_user() instead.
Definition at line 126 of file strnlen_user.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.