struct proc* copyproc(struct proc*);
int growproc(int);
void pinit(void);
-void proc_exit(void);
-int proc_kill(int);
-int proc_wait(void);
void procdump(void);
+void exit(void);
+int kill(int);
+int wait(void);
void scheduler(void) __attribute__((noreturn));
void setupsegs(struct proc*);
void sleep(void*, struct spinlock*);
// Process won't actually exit until it returns
// to user space (see trap in trap.c).
int
-proc_kill(int pid)
+kill(int pid)
{
struct proc *p;
// Exited processes remain in the zombie state
// until their parent calls wait() to find out they exited.
void
-proc_exit(void)
+exit(void)
{
struct proc *p;
int fd;
// Wait for a child process to exit and return its pid.
// Return -1 if this process has no children.
int
-proc_wait(void)
+wait(void)
{
struct proc *p;
int i, havekids, pid;
int
sys_exit(void)
{
- proc_exit();
+ exit();
return 0; // not reached
}
int
sys_wait(void)
{
- return proc_wait();
+ return wait();
}
int
if(argint(0, &pid) < 0)
return -1;
- return proc_kill(pid);
+ return kill(pid);
}
int
{
if(tf->trapno == T_SYSCALL){
if(cp->killed)
- proc_exit();
+ exit();
cp->tf = tf;
syscall();
if(cp->killed)
- proc_exit();
+ exit();
return;
}
// (If it is still executing in the kernel, let it keep running
// until it gets to the regular system call return.)
if(cp && cp->killed && (tf->cs&3) == DPL_USER)
- proc_exit();
+ exit();
// Force process to give up CPU on clock tick.
// If interrupts were on while locks held, would need to check nlock.