Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | RSS feed

  1. /*
  2. FUNCTION
  3. <<bzero>>---initialize memory to zero
  4.  
  5. INDEX
  6.         bzero
  7.  
  8. ANSI_SYNOPSIS
  9.         #include <strings.h>
  10.         void bzero(void *<[b]>, size_t <[length]>);
  11.  
  12. TRAD_SYNOPSIS
  13.         #include <strings.h>
  14.         void bzero(<[b]>, <[length]>)
  15.         void *<[b]>;
  16.         size_t <[length]>;
  17.  
  18. DESCRIPTION
  19. <<bzero>> initializes <[length]> bytes of memory, starting at address
  20. <[b]>, to zero.
  21.  
  22. RETURNS
  23. <<bzero>> does not return a result.
  24.  
  25. PORTABILITY
  26. <<bzero>> is in the Berkeley Software Distribution.
  27. Neither ANSI C nor the System V Interface Definition (Issue 2) require
  28. <<bzero>>.
  29.  
  30. <<bzero>> requires no supporting OS subroutines.
  31. */
  32.  
  33. #include <strings.h>
  34.  
  35. _VOID
  36. _DEFUN (bzero, (b, length),
  37.         void *b _AND
  38.         size_t length)
  39. {
  40.   char *ptr = (char *)b;
  41.   while (length--)
  42.     *ptr++ = 0;
  43. }
  44.