summaryrefslogtreecommitdiff
path: root/sysfile.c
diff options
context:
space:
mode:
authorRuss Cox <[email protected]>2009-08-30 23:02:08 -0700
committerRuss Cox <[email protected]>2009-08-30 23:02:08 -0700
commit48755214c9a02d6249caf3126d3b41d67eda4730 (patch)
tree2edc8b996fd7c3ef2da8876d657140e242999d93 /sysfile.c
parent0aef8914959af9e472852611eb6352c211093d35 (diff)
downloadxv6-labs-48755214c9a02d6249caf3126d3b41d67eda4730.tar.gz
xv6-labs-48755214c9a02d6249caf3126d3b41d67eda4730.tar.bz2
xv6-labs-48755214c9a02d6249caf3126d3b41d67eda4730.zip
assorted fixes:
* rename c/cp to cpu/proc * rename cpu.context to cpu.scheduler * fix some comments * formatting for printout
Diffstat (limited to 'sysfile.c')
-rw-r--r--sysfile.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sysfile.c b/sysfile.c
index ae7d07c..3eec766 100644
--- a/sysfile.c
+++ b/sysfile.c
@@ -18,7 +18,7 @@ argfd(int n, int *pfd, struct file **pf)
if(argint(n, &fd) < 0)
return -1;
- if(fd < 0 || fd >= NOFILE || (f=cp->ofile[fd]) == 0)
+ if(fd < 0 || fd >= NOFILE || (f=proc->ofile[fd]) == 0)
return -1;
if(pfd)
*pfd = fd;
@@ -35,8 +35,8 @@ fdalloc(struct file *f)
int fd;
for(fd = 0; fd < NOFILE; fd++){
- if(cp->ofile[fd] == 0){
- cp->ofile[fd] = f;
+ if(proc->ofile[fd] == 0){
+ proc->ofile[fd] = f;
return fd;
}
}
@@ -89,7 +89,7 @@ sys_close(void)
if(argfd(0, &fd, &f) < 0)
return -1;
- cp->ofile[fd] = 0;
+ proc->ofile[fd] = 0;
fileclose(f);
return 0;
}
@@ -338,8 +338,8 @@ sys_chdir(void)
return -1;
}
iunlock(ip);
- iput(cp->cwd);
- cp->cwd = ip;
+ iput(proc->cwd);
+ proc->cwd = ip;
return 0;
}
@@ -356,13 +356,13 @@ sys_exec(void)
for(i=0;; i++){
if(i >= NELEM(argv))
return -1;
- if(fetchint(cp, uargv+4*i, (int*)&uarg) < 0)
+ if(fetchint(proc, uargv+4*i, (int*)&uarg) < 0)
return -1;
if(uarg == 0){
argv[i] = 0;
break;
}
- if(fetchstr(cp, uarg, &argv[i]) < 0)
+ if(fetchstr(proc, uarg, &argv[i]) < 0)
return -1;
}
return exec(path, argv);
@@ -382,7 +382,7 @@ sys_pipe(void)
fd0 = -1;
if((fd0 = fdalloc(rf)) < 0 || (fd1 = fdalloc(wf)) < 0){
if(fd0 >= 0)
- cp->ofile[fd0] = 0;
+ proc->ofile[fd0] = 0;
fileclose(rf);
fileclose(wf);
return -1;