171671b9obrien/* memset
271671b9obrien   This implementation is in the public domain.  */
371671b9obrien
471671b9obrien/*
571671b9obrien
671671b9obrien@deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, size_t @var{count})
771671b9obrien
871671b9obrienSets the first @var{count} bytes of @var{s} to the constant byte
971671b9obrien@var{c}, returning a pointer to @var{s}.
1071671b9obrien
1171671b9obrien@end deftypefn
1271671b9obrien
1371671b9obrien*/
1471671b9obrien
1571671b9obrien#include <ansidecl.h>
1671671b9obrien#include <stddef.h>
1771671b9obrien
1871671b9obrienPTR
190acbbeedimmemset (PTR dest, register int val, register size_t len)
2071671b9obrien{
2171671b9obrien  register unsigned char *ptr = (unsigned char*)dest;
2271671b9obrien  while (len-- > 0)
2371671b9obrien    *ptr++ = val;
2471671b9obrien  return dest;
2571671b9obrien}
26