diff options
author | rsc <rsc> | 2006-09-07 14:13:26 +0000 |
---|---|---|
committer | rsc <rsc> | 2006-09-07 14:13:26 +0000 |
commit | 224f6598c1c6f794bcbe39c510c682efba6c1de5 (patch) | |
tree | e1a02ab4045003e50c078eaab0a6988b8d9f72bd /file.c | |
parent | 31085bb4166c18b3dee059160d64b4edd7c5e2f4 (diff) | |
download | xv6-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.c | 14 |
1 files changed, 1 insertions, 13 deletions
@@ -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) { |