root/lib/libc/memset.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. memset

   1 /* memset
   2    This implementation is in the public domain.  */
   3 
   4 /*
   5 
   6 @deftypefn Supplemental void* memset (void *@var{s}, int @var{c}, size_t @var{count})
   7 
   8 Sets the first @var{count} bytes of @var{s} to the constant byte
   9 @var{c}, returning a pointer to @var{s}.
  10 
  11 @end deftypefn
  12 
  13 */
  14 
  15 void*
  16 memset (void* dest, register int val, register long len)
  17 {
  18   register unsigned char *ptr = (unsigned char*)dest;
  19   while (len-- > 0)
  20     *ptr++ = val;
  21   return dest;
  22 }

/* [<][>][^][v][top][bottom][index][help] */