Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
strnlen_user.c File Reference
#include <linux/kernel.h>
#include <linux/export.h>
#include <linux/uaccess.h>
#include <asm/word-at-a-time.h>

Go to the source code of this file.

Macros

#define aligned_byte_mask(n)   (~0xfful << (BITS_PER_LONG - 8 - 8*(n)))
 

Functions

long strnlen_user (const char __user *str, long count)
 
 EXPORT_SYMBOL (strnlen_user)
 
long strlen_user (const char __user *str)
 
 EXPORT_SYMBOL (strlen_user)
 

Macro Definition Documentation

#define aligned_byte_mask (   n)    (~0xfful << (BITS_PER_LONG - 8 - 8*(n)))

Definition at line 11 of file strnlen_user.c.

Function Documentation

EXPORT_SYMBOL ( strnlen_user  )
EXPORT_SYMBOL ( strlen_user  )
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.

long strnlen_user ( const char __user str,
long  count 
)

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.

Definition at line 95 of file strnlen_user.c.