*** UNIX MANUAL PAGE BROWSER ***

A Nergahak database for man pages research.

Navigation

Directory Browser

1Browse 4.4BSD4.4BSD
1Browse Digital UNIXDigital UNIX 4.0e
1Browse FreeBSDFreeBSD 14.3
1Browse MINIXMINIX 3.4.0rc6-d5e4fc0
1Browse NetBSDNetBSD 10.1
1Browse OpenBSDOpenBSD 7.7
1Browse UNIX v7Version 7 UNIX
1Browse UNIX v10Version 10 UNIX

Manual Page Search

Manual Page Result

0 Command: explicit_memset | Section: 3 | Source: MINIX | File: explicit_memset.3
EXPLICIT_MEMSET(3) FreeBSD Library Functions Manual EXPLICIT_MEMSET(3) NAME explicit_memset - guarantee writing a byte to a byte string LIBRARY Standard C Library (libc, -lc) SYNOPSIS #include <string.h> void * explicit_memset(void *b, int c, size_t len); DESCRIPTION The explicit_memset() function writes len bytes of value c (converted to an unsigned char) to the string b. It is guaranteed not to be optimized away by the compiler even if b is no longer used and is about to be freed or go out of scope. RETURN VALUES The explicit_memset() function returns the original value of b. EXAMPLES Create a buffer on the stack for a secret key, use it, and then zero it in memory before throwing it away. void f(void) { uint8_t key[32]; crypto_random(key, sizeof(key)); do_crypto_stuff(key, sizeof(key)); ... explicit_memset(key, 0, sizeof(key)); } SEE ALSO consttime_memequal(3), memset(3) HISTORY The explicit_memset() function appeared in NetBSD 7.0. FreeBSD 14.1-RELEASE-p8 August 28, 2013 FreeBSD 14.1-RELEASE-p8

Navigation Options