summaryrefslogtreecommitdiff
path: root/syscall.c
diff options
context:
space:
mode:
authorkaashoek <kaashoek>2006-08-12 01:25:45 +0000
committerkaashoek <kaashoek>2006-08-12 01:25:45 +0000
commit0633b9715e106ac97fafcf3a68c06da1f0cf873a (patch)
tree0049ae867f8f94fe0e819a9c33b7b84989561c43 /syscall.c
parent24437cd554995f729969299e72699e2ba5d9b068 (diff)
downloadxv6-labs-0633b9715e106ac97fafcf3a68c06da1f0cf873a.tar.gz
xv6-labs-0633b9715e106ac97fafcf3a68c06da1f0cf873a.tar.bz2
xv6-labs-0633b9715e106ac97fafcf3a68c06da1f0cf873a.zip
unlink,mknod,create with multi-component pathnames should work now
remove console init code from userfs
Diffstat (limited to 'syscall.c')
-rw-r--r--syscall.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/syscall.c b/syscall.c
index 324926e..dfd86c4 100644
--- a/syscall.c
+++ b/syscall.c
@@ -253,20 +253,17 @@ sys_open(void)
uint arg0, arg1;
int ufd;
struct fd *fd;
- struct inode *dp;
int l;
if(fetcharg(0, &arg0) < 0 || fetcharg(1, &arg1) < 0)
return -1;
if((l = checkstring(arg0)) < 0)
return -1;
- if((ip = namei(cp->mem + arg0)) == 0) {
+ if((ip = namei(cp->mem + arg0, 0)) == 0) {
if (arg1 & O_CREATE) {
if (l >= DIRSIZ)
return -1;
- dp = iget(rootdev, 1); // XXX should parse name
- ip = mknod (dp, cp->mem + arg0, T_FILE, 0, 0);
- iput(dp);
+ ip = mknod (cp->mem + arg0, T_FILE, 0, 0);
if (ip == 0) return -1;
} else return -1;
}
@@ -303,7 +300,7 @@ int
sys_mknod(void)
{
struct proc *cp = curproc[cpu()];
- struct inode *dp, *nip;
+ struct inode *nip;
uint arg0, arg1, arg2, arg3;
int l;
@@ -317,10 +314,7 @@ sys_mknod(void)
if(l >= DIRSIZ)
return -1;
- dp = iget(rootdev, 1); // XXX should parse name
- nip = mknod (dp, cp->mem + arg0, (short) arg1, (short) arg2,
- (short) arg3);
- iput(dp);
+ nip = mknod (cp->mem + arg0, (short) arg1, (short) arg2, (short) arg3);
iput(nip);
return (nip == 0) ? -1 : 0;
}
@@ -357,7 +351,7 @@ sys_exec(void)
return -1;
if(checkstring(arg0) < 0)
return -1;
- ip = namei(cp->mem + arg0);
+ ip = namei(cp->mem + arg0, 0);
if(ip == 0)
return -1;
@@ -495,7 +489,7 @@ sys_block(void)
ip->type, ip->nlink, ip->size, ip->addrs[0]);
iput(ip);
- ip = namei(".././//./../usertests");
+ ip = namei(".././//./../usertests", 0);
if(ip){
cprintf("namei(usertests): %d %d %d %d %d %d %d %d\n",
ip->dev, ip->inum, ip->count, ip->busy,