diff options
author | rsc <rsc> | 2006-09-07 14:13:26 +0000 |
---|---|---|
committer | rsc <rsc> | 2006-09-07 14:13:26 +0000 |
commit | 224f6598c1c6f794bcbe39c510c682efba6c1de5 (patch) | |
tree | e1a02ab4045003e50c078eaab0a6988b8d9f72bd /sysproc.c | |
parent | 31085bb4166c18b3dee059160d64b4edd7c5e2f4 (diff) | |
download | xv6-labs-224f6598c1c6f794bcbe39c510c682efba6c1de5.tar.gz xv6-labs-224f6598c1c6f794bcbe39c510c682efba6c1de5.tar.bz2 xv6-labs-224f6598c1c6f794bcbe39c510c682efba6c1de5.zip |
refactor syscall code
Diffstat (limited to 'sysproc.c')
-rw-r--r-- | sysproc.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -44,7 +44,7 @@ sys_kill(void) { int pid; - if(fetcharg(0, &pid) < 0) + if(argint(0, &pid) < 0) return -1; return proc_kill(pid); } @@ -52,20 +52,19 @@ sys_kill(void) int sys_getpid(void) { - struct proc *cp = curproc[cpu()]; - return cp->pid; + return curproc[cpu()]->pid; } int sys_sbrk(void) { - uint addr; + int addr; int n; struct proc *cp = curproc[cpu()]; - if(fetcharg(0, &n) < 0) + if(argint(0, &n) < 0) return -1; - if((addr = growproc(n)) == 0xffffffff) + if((addr = growproc(n)) < 0) return -1; setupsegs(cp); return addr; |