static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) { if (!tty) { printk("pty_unix98_ioctl called with NULL tty!\n"); return -EIO; } switch(cmd) { case TIOCGPTN: /* Get PT Number */ return pty_get_device_number(tty, (unsigned int *)arg); } return pty_bsd_ioctl(tty,file,cmd,arg); }
static int pty_unix98_ioctl(struct tty_struct *tty, struct file *file, unsigned int cmd, unsigned long arg) { if (!tty) { printk("pty_unix98_ioctl called with NULL tty!\n"); return -EIO; } switch(cmd) { case TIOCSPTLCK: /* Set PT Lock (disallow slave open) */ return pty_set_lock(tty, (int __user *)arg); case TIOCGPTN: /* Get PT Number */ return pty_get_device_number(tty, (unsigned int __user *)arg); } return -ENOIOCTLCMD; }