From 224f6598c1c6f794bcbe39c510c682efba6c1de5 Mon Sep 17 00:00:00 2001 From: rsc Date: Thu, 7 Sep 2006 14:13:26 +0000 Subject: refactor syscall code --- file.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'file.c') 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) { -- cgit v1.2.3