---
name: "set_bit"
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/set_bit"
---

# set\_bit(9)

Atomically set a bit in memory

## NAME

set\_bit - Atomically set a bit in memory

## SYNOPSIS

**void set\_bit(long** *nr***, volatile unsigned long \*** *addr***);**

## ARGUMENTS

*nr*

the bit to set

*addr*

the address to start counting from

## DESCRIPTION

This function is atomic and may not be reordered. See **\_\_set\_bit** if you do not require the atomic guarantees.

## NOTE

there are no guarantees that this function will not be reordered on non x86 architectures, so if you are writing portable code, make sure not to rely on its reordering guarantees.

Note that *nr* may be almost arbitrarily large; this function is not restricted to acting on a single-word quantity.

## COPYRIGHT
