---
name: "idr_replace"
section: "9"
platform: "linux"
package: "linux-manual-4.9"
version: "4.9.228-1"
release: "Debian 9 (Stretch)"
platforms: ["linux"]
url: "https://new.carta.tech/idr_replace"
---

# idr\_replace(9)

replace pointer for given id

## NAME

idr\_replace - replace pointer for given id

## SYNOPSIS

**void \* idr\_replace(struct idr \*** *idp***, void \*** *ptr***, int** *id***);**

## ARGUMENTS

*idp*

idr handle

*ptr*

pointer you want associated with the id

*id*

lookup key

## DESCRIPTION

Replace the pointer registered with an id and return the old value. A **-ENOENT** return indicates that *id* was not found. A **-EINVAL** return indicates that *id* was not within valid constraints.

The caller must serialize with writers.

## COPYRIGHT
