getpid: use tos

This commit is contained in:
aiju 2011-08-20 16:10:02 +02:00
parent 8434f98cdd
commit 23fcac090c

View file

@ -1,17 +1,9 @@
#include <u.h> #include <u.h>
#include <libc.h> #include <libc.h>
#include <tos.h>
int int
getpid(void) getpid(void)
{ {
char b[20]; return _tos->pid;
int f;
memset(b, 0, sizeof(b));
f = open("#c/pid", 0);
if(f >= 0) {
read(f, b, sizeof(b));
close(f);
}
return atol(b);
} }