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