xref: /PHP-7.2/main/explicit_bzero.c (revision 7a7ec01a)
1 /*
2   +----------------------------------------------------------------------+
3   | PHP Version 7                                                        |
4   +----------------------------------------------------------------------+
5   | Copyright (c) 1997-2018 The PHP Group                                |
6   +----------------------------------------------------------------------+
7   | This source file is subject to version 3.01 of the PHP license,      |
8   | that is bundled with this package in the file LICENSE, and is        |
9   | available through the world-wide-web at the following url:           |
10   | http://www.php.net/license/3_01.txt                                  |
11   | If you did not receive a copy of the PHP license and are unable to   |
12   | obtain it through the world-wide-web, please send a note to          |
13   | license@php.net so we can mail you a copy immediately.               |
14   +----------------------------------------------------------------------+
15   | Author:                                                              |
16   +----------------------------------------------------------------------+
17 */
18 
19 /* $Id$ */
20 
21 #include "php.h"
22 
23 #ifndef HAVE_EXPLICIT_BZERO
24 
25 /*	$OpenBSD: explicit_bzero.c,v 1.4 2015/08/31 02:53:57 guenther Exp $ */
26 /*
27  * Public domain.
28  * Written by Matthew Dempsky.
29  */
30 
31 #include <string.h>
32 
33 __attribute__((weak)) void
__explicit_bzero_hook(void * dst,size_t siz)34 __explicit_bzero_hook(void *dst, size_t siz)
35 {
36 }
37 
php_explicit_bzero(void * dst,size_t siz)38 PHPAPI void php_explicit_bzero(void *dst, size_t siz)
39 {
40 	memset(dst, 0, siz);
41 	__explicit_bzero_hook(dst, siz);
42 }
43 #endif
44 /*
45  * Local variables:
46  * tab-width: 4
47  * c-basic-offset: 4
48  * End:
49  * vim600: sw=4 ts=4 fdm=marker
50  * vim<600: sw=4 ts=4
51  */
52