Various additions and fixes.
This commit is contained in:
parent
74f990ad84
commit
fd04aacee1
57 changed files with 2176 additions and 159 deletions
20
src/lib9/waitpid.c
Normal file
20
src/lib9/waitpid.c
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
#include <u.h>
|
||||
#include <libc.h>
|
||||
|
||||
int
|
||||
waitpid(void)
|
||||
{
|
||||
int n;
|
||||
char buf[512], *fld[5];
|
||||
|
||||
n = await(buf, sizeof buf-1);
|
||||
if(n <= 0)
|
||||
return -1;
|
||||
buf[n] = '\0';
|
||||
if(tokenize(buf, fld, nelem(fld)) != nelem(fld)){
|
||||
werrstr("couldn't parse wait message");
|
||||
return -1;
|
||||
}
|
||||
return atoi(fld[0]);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue