diff options
author | kaashoek <kaashoek> | 2006-08-14 14:13:52 +0000 |
---|---|---|
committer | kaashoek <kaashoek> | 2006-08-14 14:13:52 +0000 |
commit | bdb66433031ca96f2fd127995186623cd10c45b3 (patch) | |
tree | 037ffd2021f27718fba32c27cacd9ca52682b613 /syscall.c | |
parent | d15f0d1033a7da6448966d9626ec2776781e4188 (diff) | |
download | xv6-labs-bdb66433031ca96f2fd127995186623cd10c45b3.tar.gz xv6-labs-bdb66433031ca96f2fd127995186623cd10c45b3.tar.bz2 xv6-labs-bdb66433031ca96f2fd127995186623cd10c45b3.zip |
set size for directories correctly in wdir and mkfs
mkdir
ls shows stat info for each dir entry
Diffstat (limited to 'syscall.c')
-rw-r--r-- | syscall.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -294,8 +294,10 @@ sys_mkdir(void) { struct proc *cp = curproc[cpu()]; struct inode *nip; + struct inode *pip; uint arg0; int l; + struct dirent de; if(fetcharg(0, &arg0) < 0) return -1; @@ -308,7 +310,15 @@ sys_mkdir(void) nip = mknod (cp->mem + arg0, T_DIR, 0, 0); - // XXX put . and .. in + de.name[0] = '.'; + de.inum = nip->inum; + writei (nip, (char *) &de, 0, sizeof(de)); + + pip = namei(".", NAMEI_LOOKUP, 0); + de.inum = pip->inum; + de.name[1] = '.'; + iput(pip); + writei (nip, (char *) &de, sizeof(de), sizeof(de)); iput(nip); return (nip == 0) ? -1 : 0; |