---
name: "explicit_bzero"
section: "3bsd"
platform: "linux"
package: "libbsd"
version: "0.12.2-2"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/explicit_bzero/3bsd"
---

# explicit\_bzero(3bsd)

write zeroes to a byte string

## NAME

**explicit\_bzero** – write zeroes to a byte string

## LIBRARY

library “libbsd”

## SYNOPSIS

**#include \<string.h\>**

(See [libbsd(7)](/libbsd/7.md) for include usage.)

*void*\

**explicit\_bzero**(*void \*buf*, *size\_t len*);

## DESCRIPTION

The **explicit\_bzero**() function writes *len* zero bytes to the string *buf*. If *len* is zero, **explicit\_bzero**() does nothing.

The **explicit\_bzero**() variant behaves the same as the **bzero**() function, but will not be removed by a compiler's dead store optimization pass, making it useful for clearing sensitive memory such as a password.

## SEE ALSO

[bzero(3)](/bzero/3.md), [memset(3)](/memset/3.md), [swab(3)](/swab/3.md)

## HISTORY

The **explicit\_bzero**() function first appeared in OpenBSD 5.5, glibc 2.25.
