Blob
1 #include <u.h>2 #include <libc.h>4 int5 waitpid(void)6 {7 int n;8 char buf[512], *fld[5];10 n = await(buf, sizeof buf-1);11 if(n <= 0)12 return -1;13 buf[n] = '\0';14 if(tokenize(buf, fld, nelem(fld)) != nelem(fld)){15 werrstr("couldn't parse wait message");16 return -1;17 }18 return atoi(fld[0]);19 }