diff options
author | Robert Morris <[email protected]> | 2020-08-13 10:22:07 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2020-08-17 08:18:23 -0400 |
commit | 8dc71a257d80d1e2f56cd7f931ca389fbb727b5c (patch) | |
tree | b29e38cd1aab2cb526dd657ba23d636a93401580 /kernel/proc.c | |
parent | bc51626aab45f420652f20948a1ffa5398ad9446 (diff) | |
download | xv6-labs-8dc71a257d80d1e2f56cd7f931ca389fbb727b5c.tar.gz xv6-labs-8dc71a257d80d1e2f56cd7f931ca389fbb727b5c.tar.bz2 xv6-labs-8dc71a257d80d1e2f56cd7f931ca389fbb727b5c.zip |
handle another out-of-memory in fork(). the policy here is not consistent,
since other calls (e.g. exec()) panic on out of memory.
Diffstat (limited to 'kernel/proc.c')
-rw-r--r-- | kernel/proc.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/proc.c b/kernel/proc.c index 2811142..56314e5 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -161,6 +161,8 @@ proc_pagetable(struct proc *p) // An empty page table. pagetable = uvmcreate(); + if(pagetable == 0) + return 0; // map the trampoline code (for system call return) // at the highest user virtual address. |