Subversion Repositories planix.SVN

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 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