explicit_bzero(3bsd)

explicit_bzero3bsd

Write zeroes to a byte string

Usage

#include <string.h>

(See libbsd(7) for include usage.)

void

explicit_bzero(void *buf, size_t len);

Library

library “libbsd”

Overview

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.

Releases

5 releases since Debian 10 (Buster); the text changed 2 times.

  1. 10
  2. 11
  3. 12–Arch

History

The explicit_bzero() function first appeared in OpenBSD 5.5, glibc 2.25.

From libbsd 0.12.2-2 in Arch Linux 2026-11-01. Parsed by carta from the page's mdoc source.