ref: b66b8d010388d89994a5dea80d3bde4df039ec6a
parent: 5decc93c41f4ea97e725a169f2bd9fae63eed95b
author: 9ferno <[email protected]>
date: Wed Oct 20 07:26:58 EDT 2021
added getpid() required by genrandom()
--- a/include/kern.h
+++ b/include/kern.h
@@ -578,8 +578,8 @@
extern int wstat(char*, char*);
extern ulong rendezvous(ulong, ulong);
-extern intptr getpid(void);
-extern intptr getppid(void);
+extern u32 getpid(void);
+extern u32 getppid(void);
extern void rerrstr(char*, uint);
extern char* sysname(void);
extern void werrstr(char*, ...);
--- a/libsec/port/genrandom.c
+++ b/libsec/port/genrandom.c
@@ -1,6 +1,8 @@
#include "os.h"
#include <libsec.h>
+extern u32 getpid(void);
+
static void
init(Chachastate *cs)
{
--- a/os/port/proc.c
+++ b/os/port/proc.c
@@ -827,3 +827,9 @@
kproc(s, rproc, r, KPDUP);
return r;
}
+
+u32
+getpid(void)
+{
+ return up->pid;
+}