---
name: "atomic64_xchg"
section: "9"
platform: "linux"
package: "linux-manual-2.6.32"
version: "2.6.32-48squeeze6"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/atomic64_xchg"
---

# atomic64\_xchg(9)

xchg atomic64 variable

## NAME

atomic64\_xchg - xchg atomic64 variable

## SYNOPSIS

**u64 atomic64\_xchg(atomic64\_t \*** *ptr***, u64** *new\_val***);**

## ARGUMENTS

*ptr*

pointer to type atomic64\_t

*new\_val*

value to assign

## DESCRIPTION

Atomically xchgs the value of *ptr* to *new\_val* and returns the old value.

## COPYRIGHT
