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

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