1 #include <u.h> 2 #include <libc.h> 3 4 void* memset(void * ap,int c,ulong n)5 memset(void *ap, int c, ulong n) 6 { 7 char *p; 8 9 p = ap; 10 while(n > 0) { 11 *p++ = c; 12 n--; 13 } 14 return ap; 15 } 16