explicit_bzero(3bsd)

πŸ“¦
version 0.12.2 Β· 2 versions
  • 0.12.2 Β· alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian bookworm, debian trixie, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.11.5 Β· ubuntu jammy
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian bookworm, debian trixie, epel 10, epel 9, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸŽ€ explicit_bzero β€” the manual page, but make it slay πŸŽ€

okay bestie, come sit with me πŸ’– this is explicit_bzero(3bsd), a lil function from the BSD world that is genuinely iconic and also extremely serious business. it's giving "I wipe your secrets and I mean it." no cap.


✨ NAME ✨

explicit_bzero β€” write zeroes to a byte string 🫢


πŸ“š LIBRARY πŸ“š

Utility functions from BSD systems β€” that's libbsd, and you link it with -lbsd. πŸ’…


🌸 SYNOPSIS 🌸

#include <string.h>
(See libbsd(7) for include usage.)

void
explicit_bzero(void *buf, size_t len);
heads up bestie: peep libbsd(7) for the whole include-usage situation, because it's a whole thing. iykyk 🧚

πŸ’– DESCRIPTION πŸ’–

so like. the explicit_bzero() function writes len zero bytes into the string buf. that's it, that's the job, and she does it flawlessly. ✨

and if len is zero? then explicit_bzero() literally does nothing. zero bytes of zeroes. it's giving "girl, there was nothing to do." πŸ’€

now here's the part that makes her main character energy: explicit_bzero() behaves the same as the bzero() function, BUT β€” and this is the whole point, fr fr β€” she will not be removed by a compiler's dead store optimization pass. πŸ‘‘

which means she's useful for clearing sensitive memory such as a password. πŸ” because your compiler is out here like "hmm, nobody reads this memory afterward, let me just delete that line for you, you're welcome πŸ₯°" and you're like NO. THAT WAS MY PASSWORD. 😭 explicit_bzero() says "not on my watch." periodt.


πŸ‘€ SEE ALSO πŸ‘€

go read those too, bestie, they're the supporting cast πŸ¦‹


⭐ HISTORY ⭐

the explicit_bzero() function first appeared in OpenBSD 5.5 and in glibc 2.25. a legend from day one, honestly. 🌈


and that's the whole page!! πŸ“ this lil beauty came from the Debian crew and it's dated January 22, 2014 β€” and yeah, it's filed under explicit_bzero(3bsd) in the LOCAL section, so now you know exactly where to find her. πŸ’œ stay safe out there, wipe your passwords, love u bye πŸ«Άβœ¨πŸ’…

πŸ“¦ where this page comes from