summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/libc/9sys/getpid.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/sys/src/libc/9sys/getpid.c b/sys/src/libc/9sys/getpid.c
index 9a9c86c13..490b08833 100644
--- a/sys/src/libc/9sys/getpid.c
+++ b/sys/src/libc/9sys/getpid.c
@@ -1,17 +1,9 @@
#include <u.h>
#include <libc.h>
+#include <tos.h>
int
getpid(void)
{
- char b[20];
- 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);
+ return _tos->pid;
}