summaryrefslogtreecommitdiff
path: root/file.c
diff options
context:
space:
mode:
authorrsc <rsc>2006-09-07 14:13:26 +0000
committerrsc <rsc>2006-09-07 14:13:26 +0000
commit224f6598c1c6f794bcbe39c510c682efba6c1de5 (patch)
treee1a02ab4045003e50c078eaab0a6988b8d9f72bd /file.c
parent31085bb4166c18b3dee059160d64b4edd7c5e2f4 (diff)
downloadxv6-labs-224f6598c1c6f794bcbe39c510c682efba6c1de5.tar.gz
xv6-labs-224f6598c1c6f794bcbe39c510c682efba6c1de5.tar.bz2
xv6-labs-224f6598c1c6f794bcbe39c510c682efba6c1de5.zip
refactor syscall code
Diffstat (limited to 'file.c')
-rw-r--r--file.c14
1 files changed, 1 insertions, 13 deletions
diff --git a/file.c b/file.c
index 29f07cc..4c314ec 100644
--- a/file.c
+++ b/file.c
@@ -22,19 +22,7 @@ fileinit(void)
initlock(&fd_table_lock, "fd_table");
}
-// Allocate a file descriptor number for curproc.
-int
-fdalloc(void)
-{
- int fd;
- struct proc *p = curproc[cpu()];
- for(fd = 0; fd < NOFILE; fd++)
- if(p->ofile[fd] == 0)
- return fd;
- return -1;
-}
-
-// Allocate a file descriptor structure
+// Allocate a file structure
struct file*
filealloc(void)
{