---
name: "__put_user"
section: "9"
platform: "linux"
package: "linux-manual-2.6.26"
version: "2.6.26-29"
release: "Debian 5.0 (Lenny)"
platforms: ["linux"]
url: "https://new.carta.tech/__put_user"
---

# \_\_put\_user(9)

Write a simple value into user space, with less checking.

## NAME

\_\_put\_user - Write a simple value into user space, with less checking.

## SYNOPSIS

**\_\_put\_user(***x***,** *ptr***);**

## ARGUMENTS

*x*

Value to copy to user space.

*ptr*

Destination address, in user space.

## CONTEXT

User context only. This function may sleep.

## DESCRIPTION

This macro copies a single simple value from kernel space to user 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 *x* must be assignable to the result of dereferencing *ptr*.

Caller must check the pointer with **access\_ok** before calling this function.

Returns zero on success, or -EFAULT on error.

## COPYRIGHT
