--- /n/sources/plan9/sys/include/libc.h Wed Sep 18 22:45:28 2013 +++ /sys/include/libc.h Sun Jun 28 00:00:00 2026 @@ -9,7 +9,7 @@ * mem routines */ extern void* memccpy(void*, void*, int, ulong); -extern void* memset(void*, int, ulong); +extern void* memset(void*, int, uintptr); extern int memcmp(void*, void*, ulong); extern void* memcpy(void*, void*, ulong); extern void* memmove(void*, void*, ulong); --- /n/sources/plan9/sys/src/libc/port/memset.c Sat Jan 10 10:00:05 2015 +++ /sys/src/libc/port/memset.c Sun Jun 28 00:00:00 2026 @@ -2,7 +2,7 @@ #include void* -memset(void *ap, int c, ulong n) +memset(void *ap, int c, uintptr n) { char *p; --- /n/sources/plan9/sys/man/2/memory Sat Jun 14 00:00:00 2025 +++ /sys/man/2/memory Sun Jun 28 00:00:00 2026 @@ -26,7 +26,7 @@ void* memmove(void *s1, void *s2, ulong n) .PP .B -void* memset(void *s, int c, ulong n) +void* memset(void *s, int c, uintptr n) .SH DESCRIPTION These functions operate efficiently on memory areas (arrays of bytes bounded by a count, not terminated by a zero byte). @@ -128,6 +128,23 @@ .I memmove are handed a negative count, they abort. .PP +The last argument to +.I memset +is traditionally +.IR ulong , +but that isn't adequate on 64-bit systems. +.PP +All the +.I ulong +.I n +arguments should be +.I uintptr +instead; +.I memset +is the critical one for zeroing +.I malloc +results. +.PP .I Tsmemcmp is a variant of .I memcmp