/*1* Implements some necessary HPUX ioctls.2*3* Copyright (C) 1999-2002 Matthew Wilcox <willy with parisc-linux.org>4*5* This program is free software; you can redistribute it and/or modify6* it under the terms of the GNU General Public License as published by7* the Free Software Foundation; either version 2 of the License, or8* (at your option) any later version.9*10* This program is distributed in the hope that it will be useful,11* but WITHOUT ANY WARRANTY; without even the implied warranty of12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13* GNU General Public License for more details.14*15* You should have received a copy of the GNU General Public License16* along with this program; if not, write to the Free Software17* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA18*/1920/*21* Supported ioctls:22* TCGETA23* TCSETA24* TCSETAW25* TCSETAF26* TCSBRK27* TCXONC28* TCFLSH29* TIOCGWINSZ30* TIOCSWINSZ31* TIOCGPGRP32* TIOCSPGRP33*/3435#include <linux/sched.h>36#include <linux/syscalls.h>37#include <asm/errno.h>38#include <asm/ioctl.h>39#include <asm/termios.h>40#include <asm/uaccess.h>4142static int hpux_ioctl_t(int fd, unsigned long cmd, unsigned long arg)43{44int result = -EOPNOTSUPP;45int nr = _IOC_NR(cmd);46switch (nr) {47case 106:48result = sys_ioctl(fd, TIOCSWINSZ, arg);49break;50case 107:51result = sys_ioctl(fd, TIOCGWINSZ, arg);52break;53}54return result;55}5657int hpux_ioctl(int fd, unsigned long cmd, unsigned long arg)58{59int result = -EOPNOTSUPP;60int type = _IOC_TYPE(cmd);61switch (type) {62case 'T':63/* Our structures are now compatible with HPUX's */64result = sys_ioctl(fd, cmd, arg);65break;66case 't':67result = hpux_ioctl_t(fd, cmd, arg);68break;69}70return result;71}727374