diff options
author | rtm <rtm> | 2006-06-27 14:35:53 +0000 |
---|---|---|
committer | rtm <rtm> | 2006-06-27 14:35:53 +0000 |
commit | c41f1de5d41a527a3fa2d1e94215766130eac456 (patch) | |
tree | 86f6a467be8b42aec42a05299789f39ace9cc5e2 /proc.c | |
parent | b61c2547b8b489cab16984c0940a1cb6593a2a3d (diff) | |
download | xv6-labs-c41f1de5d41a527a3fa2d1e94215766130eac456.tar.gz xv6-labs-c41f1de5d41a527a3fa2d1e94215766130eac456.tar.bz2 xv6-labs-c41f1de5d41a527a3fa2d1e94215766130eac456.zip |
file descriptors
pipes
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -2,6 +2,7 @@ #include "mmu.h" #include "x86.h" #include "param.h" +#include "fd.h" #include "proc.h" #include "defs.h" @@ -49,6 +50,7 @@ newproc() struct proc *np; struct proc *op = curproc[cpu()]; unsigned *sp; + int fd; for(np = &proc[1]; np < &proc[NPROC]; np++) if(np->state == UNUSED) @@ -80,6 +82,13 @@ newproc() np->esp = (unsigned) sp; np->ebp = (unsigned) sp; + // copy file descriptors + for(fd = 0; fd < NOFILE; fd++){ + np->fds[fd] = op->fds[fd]; + if(np->fds[fd]) + np->fds[fd]->count += 1; + } + np->state = RUNNABLE; cprintf("newproc %x\n", np); |