bzero(3) Library Functions Manual bzero(3) bzero, explicit_bzero - C (libc, -lc) #include void bzero(void s[.n], size_t n); #include void explicit_bzero(void s[.n], size_t n); The bzero() function erases the data in the n bytes of the memory starting at the location pointed to by s, by writing zeros (bytes containing '\0') to that area. explicit_bzero() bzero(). bzero() , , , , << >>. . attributes(7). +----------------------------+----------------------------------------------------------+--------------------------+ | | | | +----------------------------+----------------------------------------------------------+--------------------------+ |bzero(), explicit_bzero() | | MT-Safe | +----------------------------+----------------------------------------------------------+--------------------------+ . explicit_bzero() glibc 2.25. explicit_bzero() , BSD. , memset_explicit() memset_s(). bzero() 4.3BSD. Marked as LEGACY in POSIX.1-2001. Removed in POSIX.1-2008. The explicit_bzero() function addresses a problem that security-conscious applications may run into when using bzero(): if the compiler can deduce that the location to be zeroed will never again be touched by a correct program, then it may remove the bzero() call altogether. This is a problem if the intent of the bzero() call was to erase sensitive data (e.g., passwords) to prevent the possibility that the data was leaked by an incorrect or compromised program. Calls to explicit_bzero() are never optimized away by the compiler. explicit_bzero() , : o explicit_bzero() , ( bzero()). , . explicit_bzero() . o explicit_bzero() . , , , ( explicit_bzero(), ), explicit_bzero() , ( ). , , , , , , explicit_bzero() , , . , volatile . , , , , ( ) . , explicit_bzero(). explicit_bzero() , explicit_bzero() , . bstring(3), memset(3), swab(3) () Artyom Kunyov , Azamat Hackimov , Dmitriy Ovchinnikov , Dmitry Bolkhovskikh , ITriskTI , Yuri Kozlov , Kirill Rekhov ; GNU (GNU General Public License - GPL, 3 ) , - . - , , () () () <>. Linux 6.9.1 15 2024 . bzero(3)