__get_user(9)

__get_user9

Get a simple variable from user space, with less checking.

Usage

__get_user(x, ptr);

Arguments

x

Variable to store result.

ptr

Source address, in user space.

Context

User context only. This function may sleep.

Overview

This macro copies a single simple variable from user space to kernel space. It supports simple types like char and int, but not larger data types like structures or arrays.

ptr must have pointer-to-simple-variable type, and the result of dereferencing ptr must be assignable to x without a cast.

Caller must check the pointer with access_ok before calling this function.

Returns zero on success, or -EFAULT on error. On error, the variable x is set to zero.

Releases

2 releases since Debian 4.0 (Etch); the text changed 1 time.

  1. 4.0
  2. 5.0

From linux-manual-2.6.26 2.6.26-29 in Debian 5.0 (Lenny). Parsed by carta from the page's man source.