fix config file path
[AROS.git] / compiler / clib / bzero.c
blobbcd028ea6079686289882244da75c4ddfcfd5eb8
1 /*
2 Copyright © 1995-2012, The AROS Development Team. All rights reserved.
3 $Id$
5 POSIX.1-2001 function bzero().
6 Function is deprecated and removed from POSIX.1-2008
7 */
9 #include <proto/exec.h>
11 #define bzero bzero_inline
12 #include <strings.h>
13 #undef bzero
15 /*****************************************************************************
17 NAME */
18 #include <strings.h>
20 void bzero (
22 /* SYNOPSIS */
23 void * ptr,
24 size_t len)
26 /* FUNCTION
27 Write len zero bytes to ptr. If len is zero, does nothing.
29 INPUTS
30 ptr - The first byte of the area in memory to be cleared.
31 len - How many bytes to clear.
33 RESULT
35 NOTES
37 EXAMPLE
39 BUGS
41 SEE ALSO
43 INTERNALS
45 ******************************************************************************/
47 UBYTE * bptr = ptr;
49 while (((IPTR)bptr)&(AROS_LONGALIGN-1) && len)
51 *bptr ++ = 0;
52 len --;
55 if (len > sizeof(ULONG))
57 ULONG * ulptr = (ULONG *)bptr;
59 while (len > sizeof(ULONG))
61 *ulptr ++ = 0UL;
62 len -= sizeof(ULONG);
65 bptr = (UBYTE *)ulptr;
68 while (len --)
69 *bptr ++ = 0;
71 } /* bzero */