[BACK]Return to ioctl.c CVS log [TXT][DIR] Up to [Development] / linux-2.4-xfs / arch / parisc / hpux

File: [Development] / linux-2.4-xfs / arch / parisc / hpux / ioctl.c (download)

Revision 1.1, Wed Dec 31 00:54:49 2003 UTC (13 years, 10 months ago) by cattelan
Branch: MAIN
CVS Tags: HEAD

Initial Import 2.4.24pre2

/*
 * linux/arch/parisc/hpux/ioctl.c
 *
 * implements some necessary HPUX ioctls.
 */

/*
 * Supported ioctls:
 *   TCGETA
 *   TCSETA
 *   TCSETAW
 *   TCSETAF
 *   TCSBRK
 *   TCXONC
 *   TCFLSH
 *   TIOCGWINSZ
 *   TIOCSWINSZ
 *   TIOCGPGRP
 *   TIOCSPGRP
 */

#include <linux/sched.h>
#include <linux/smp_lock.h>
#include <asm/errno.h>
#include <asm/ioctl.h>
#include <asm/termios.h>
#include <asm/uaccess.h>

int sys_ioctl(unsigned int, unsigned int, unsigned long);
 
static int hpux_ioctl_t(int fd, unsigned long cmd, unsigned long arg)
{
	int result = -EOPNOTSUPP;
	int nr = _IOC_NR(cmd);
	switch (nr) {
	case 106:
		result = sys_ioctl(fd, TIOCSWINSZ, arg);
		break;
	case 107:
		result = sys_ioctl(fd, TIOCGWINSZ, arg);
		break;
	}
	return result;
}

int hpux_ioctl(int fd, unsigned long cmd, unsigned long arg)
{
	int result = -EOPNOTSUPP;
	int type = _IOC_TYPE(cmd);
	switch (type) {
	case 'T':
		/* Our structures are now compatible with HPUX's */
		result = sys_ioctl(fd, cmd, arg);
		break;
	case 't':
		result = hpux_ioctl_t(fd, cmd, arg);
		break;
	}
	return result;
}