kernel: introduce devself

Devself provides to each process access to its own structures.

So far it contains four files:

- pid
- ppid
- pipes	used to implement pipe(2)
- segments used to implement segattach, segdetach and segfree
This commit is contained in:
2016-12-11 01:19:51 +01:00
parent f52a185030
commit c6de6b66e9
18 changed files with 480 additions and 315 deletions

View File

@@ -38,13 +38,8 @@ main(void)
exits("FAIL");
}
rfork(RFNOMNT|RFCNAMEG);
if(getppid() != -1){
print("FAIL: rfork(RFNOMNT|RFCNAMEG)); getppid() != -1\n");
exits("FAIL");
}
rerrstr(err, ERRMAX);
if(strcmp("getppid: cannot open neither #c/ppid nor /dev/ppid", err)){
print("FAIL: rfork(RFNOMNT|RFCNAMEG)); getppid() set errstr '%s'\n", err);
if(getppid() != ppid){
print("FAIL: rfork(RFNOMNT|RFCNAMEG)); getppid() != getmainpid()\n");
exits("FAIL");
}
exits(nil);