summaryrefslogtreecommitdiff
path: root/newlib/libc/string/bzero.c
blob: e9e78c938879af61bf83d7e35eaedc527a5b7ede (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
FUNCTION
<<bzero>>---initialize memory to zero

INDEX
	bzero

ANSI_SYNOPSIS
	#include <string.h>
	void bzero(char *<[b]>, size_t <[length]>);

TRAD_SYNOPSIS
	#include <string.h>
	void bzero(<[b]>, <[length]>)
	char *<[b]>;
	size_t <[length]>;

DESCRIPTION
<<bzero>> initializes <[length]> bytes of memory, starting at address
<[b]>, to zero.

RETURNS
<<bzero>> does not return a result.

PORTABILITY
<<bzero>> is in the Berkeley Software Distribution.
Neither ANSI C nor the System V Interface Definition (Issue 2) require
<<bzero>>.

<<bzero>> requires no supporting OS subroutines.
*/

#include <string.h>

_VOID
_DEFUN (bzero, (b, length),
	char *b _AND
	size_t length)
{
  while (length--)
    *b++ = 0;
}