summaryrefslogtreecommitdiff
path: root/sys/src/libc
diff options
context:
space:
mode:
authoraiju <aiju@phicode.de>2011-08-20 16:10:02 +0200
committeraiju <aiju@phicode.de>2011-08-20 16:10:02 +0200
commit23fcac090ca7e6d0856572f107ca6b2ade0ada5b (patch)
tree551609043ee46c12a14eb84d3e36f2209336a10c /sys/src/libc
parent8434f98cdda98c5463ccc3ba89feeeda064e873c (diff)
getpid: use tos
Diffstat (limited to 'sys/src/libc')
-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;
}