]> git.lizzy.rs Git - plan9front.git/blob - sys/src/libc/9sys/waitpid.c
libtags, zuke: add *.mod support (thanks kemal)
[plan9front.git] / sys / src / libc / 9sys / waitpid.c
1 #include <u.h>
2 #include <libc.h>
3 #include <fcall.h>
4
5 int
6 waitpid(void)
7 {
8         int n;
9         char buf[512], *fld[5];
10
11         n = await(buf, sizeof buf-1);
12         if(n <= 0)
13                 return -1;
14         buf[n] = '\0';
15         if(tokenize(buf, fld, nelem(fld)) != nelem(fld)){
16                 werrstr("couldn't parse wait message");
17                 return -1;
18         }
19         return atoi(fld[0]);
20 }
21