when working on the profiling i noticed, not for the first time, that getpid calls memset to clear the whole buffer, but only the first byte needs to be cleared, which can easily be done directly. Notes: Mon Mar 26 21:28:54 EDT 2012 geoff it's not quite that simple, so i've done it differently. Reference: /n/sources/patch/sorry/getpid-less-memset Date: Tue Mar 27 01:07:59 CES 2012 Signed-off-by: forsyth@terzarima.net Reviewed-by: geoff --- /sys/src/libc/9sys/getpid.c Tue Mar 27 01:07:00 2012 +++ /sys/src/libc/9sys/getpid.c Tue Mar 27 01:06:57 2012 @@ -7,7 +7,7 @@ char b[20]; int f; - memset(b, 0, sizeof(b)); + b[0] = 0; f = open("#c/pid", 0); if(f >= 0) { read(f, b, sizeof(b));