diff -urN -X dontdiff linux/fs/open.c doclose/fs/open.c --- linux/fs/open.c Sat Aug 12 09:11:31 2000 +++ doclose/fs/open.c Sat Aug 12 09:00:41 2000 @@ -800,10 +800,9 @@ * releasing the fd. This ensures that one clone task can't release * an fd while another clone is opening it. */ -asmlinkage long sys_close(unsigned int fd) +int do_close(struct files_struct *files, unsigned int fd) { struct file * filp; - struct files_struct *files = current->files; write_lock(&files->file_lock); if (fd >= files->max_fds) @@ -821,6 +820,12 @@ write_unlock(&files->file_lock); return -EBADF; } + +asmlinkage long sys_close(unsigned int fd) +{ + return do_close(current->files, fd); +} + /* * This routine simulates a hangup on the tty, to arrange that users diff -urN -X dontdiff linux/include/linux/fs.h doclose/include/linux/fs.h --- linux/include/linux/fs.h Sat Aug 12 09:11:31 2000 +++ doclose/include/linux/fs.h Sat Aug 12 09:03:40 2000 @@ -890,6 +890,7 @@ /* fs/open.c */ +extern int do_close(struct files_struct *, unsigned int); asmlinkage long sys_open(const char *, int, int); asmlinkage long sys_close(unsigned int); /* yes, it's really unsigned */ extern int do_truncate(struct dentry *, loff_t start);