.\" the source, must acknowledge the copyright and authors of this work.
.\" %%%LICENSE_END
.\"
-.TH BZERO 3 2017-05-03 "Linux" "Linux Programmer's Manual"
+.TH BZERO 3 2019-03-06 "Linux" "Linux Programmer's Manual"
.SH NAME
bzero, explicit_bzero \- zero a byte string
.SH SYNOPSIS
.B #include <strings.h>
.PP
.BI "void bzero(void *" s ", size_t " n );
-
+.PP
.B #include <string.h>
.PP
.BI "void explicit_bzero(void *" s ", size_t " n );
.I n
bytes of the memory starting at the location pointed to by
.IR s ,
-by writing zeroes (bytes containing \(aq\\0\(aq) to that area.
-
+by writing zeros (bytes containing \(aq\e0\(aq) to that area.
+.PP
The
.BR explicit_bzero ()
function performs the same task as
The
.BR bzero ()
function first appeared in 4.3BSD.
-
+.PP
The
.BR explicit_bzero ()
function is a nonstandard extension that is also present on some of the BSDs.
Calls to
.BR explicit_bzero ()
are never optimized away by the compiler.
-
+.PP
The
.BR explicit_bzero ()
function does not solve all problems associated with erasing sensitive data:
it may force a variable that would otherwise have been optimized
into a register to instead be maintained in (more vulnerable)
RAM for its entire lifetime.
-
+.PP
Notwithstanding the above details, for security-conscious applications, using
.BR explicit_bzero ()
is generally preferable to not using it.