return error;
}
-int dupfd(struct file *file, unsigned int start)
+static int dupfd(struct file *file, unsigned int start)
{
struct files_struct * files = current->files;
int fd;
FD_SET(fd, files->open_fds);
FD_CLR(fd, files->close_on_exec);
spin_unlock(&files->file_lock);
- // vx_openfd_inc(fd);
+ vx_openfd_inc(fd);
fd_install(fd, file);
} else {
spin_unlock(&files->file_lock);
return fd;
}
-EXPORT_SYMBOL_GPL(dupfd);
-
asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd)
{
int err = -EBADF;
FD_SET(newfd, files->open_fds);
FD_CLR(newfd, files->close_on_exec);
spin_unlock(&files->file_lock);
- // vx_openfd_inc(newfd);
+ vx_openfd_inc(newfd);
if (tofree)
filp_close(tofree, files);
return -EINVAL;
}
- if (filp->f_op && filp->f_op->check_flags)
- error = filp->f_op->check_flags(arg);
- if (error)
- return error;
-
lock_kernel();
if ((arg ^ filp->f_flags) & FASYNC) {
if (filp->f_op && filp->f_op->fasync) {
EXPORT_SYMBOL(f_delown);
-static long do_fcntl(int fd, unsigned int cmd, unsigned long arg,
- struct file *filp)
+long generic_file_fcntl(int fd, unsigned int cmd,
+ unsigned long arg, struct file *filp)
{
long err = -EINVAL;
}
return err;
}
+EXPORT_SYMBOL(generic_file_fcntl);
+
+static long do_fcntl(int fd, unsigned int cmd,
+ unsigned long arg, struct file *filp)
+{
+ if (filp->f_op && filp->f_op->fcntl)
+ return filp->f_op->fcntl(fd, cmd, arg, filp);
+ return generic_file_fcntl(fd, cmd, arg, filp);
+}
asmlinkage long sys_fcntl(int fd, unsigned int cmd, unsigned long arg)
{