|
|
1.1.1.2 root 1: /*
2: * linux/fs/ioctl.c
3: *
1.1.1.10! root 4: * Copyright (C) 1991, 1992 Linus Torvalds
1.1.1.2 root 5: */
6:
1.1.1.10! root 7: #include <asm/segment.h>
1.1 root 8:
1.1.1.10! root 9: #include <linux/sched.h>
! 10: #include <linux/errno.h>
1.1.1.9 root 11: #include <linux/string.h>
1.1.1.8 root 12: #include <linux/stat.h>
1.1 root 13:
14: int sys_ioctl(unsigned int fd, unsigned int cmd, unsigned long arg)
15: {
16: struct file * filp;
1.1.1.10! root 17: int block;
1.1 root 18:
19: if (fd >= NR_OPEN || !(filp = current->filp[fd]))
20: return -EBADF;
1.1.1.10! root 21: if (S_ISREG(filp->f_inode->i_mode) && cmd == BMAP_IOCTL &&
! 22: filp->f_inode->i_op->bmap) {
! 23: block = get_fs_long((long *) arg);
! 24: block = filp->f_inode->i_op->bmap(filp->f_inode,block);
! 25: put_fs_long(block,(long *) arg);
! 26: return 0;
! 27: }
1.1.1.7 root 28: if (filp->f_op && filp->f_op->ioctl)
29: return filp->f_op->ioctl(filp->f_inode, filp, cmd,arg);
30: return -EINVAL;
1.1 root 31: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.