diff options
author | jasoni <jasoni@cvs.openbsd.org> | 2002-05-07 20:23:43 +0000 |
---|---|---|
committer | jasoni <jasoni@cvs.openbsd.org> | 2002-05-07 20:23:43 +0000 |
commit | efcc5b8a2ddcc27288d46dc4bc296e7f44d52d94 (patch) | |
tree | 6125b23e28bf5dae7a12be7c450e0b8fd2a8fc0c /sys/compat | |
parent | 34687343798ec65876c3454d71bd01a375f262b0 (diff) |
support TIOCLINUX ioctl
- from NetBSD
Diffstat (limited to 'sys/compat')
-rw-r--r-- | sys/compat/linux/linux_termios.c | 27 | ||||
-rw-r--r-- | sys/compat/linux/linux_termios.h | 13 |
2 files changed, 38 insertions, 2 deletions
diff --git a/sys/compat/linux/linux_termios.c b/sys/compat/linux/linux_termios.c index 1603d1f77dd..67dd03dc4f9 100644 --- a/sys/compat/linux/linux_termios.c +++ b/sys/compat/linux/linux_termios.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_termios.c,v 1.12 2002/03/14 01:26:50 millert Exp $ */ +/* $OpenBSD: linux_termios.c,v 1.13 2002/05/07 20:23:42 jasoni Exp $ */ /* $NetBSD: linux_termios.c,v 1.3 1996/04/05 00:01:54 christos Exp $ */ /* @@ -457,6 +457,7 @@ linux_ioctl_termios(p, v, retval) caddr_t sg; int idat; struct sys_ioctl_args ia; + char tioclinux; int error = 0; fdp = p->p_fd; @@ -589,6 +590,30 @@ linux_ioctl_termios(p, v, retval) } error = (*fp->f_ops->fo_ioctl)(fp, TIOCSETD, (caddr_t)&idat, p); goto out; + case LINUX_TIOCLINUX: + error = copyin(SCARG(uap, data), &tioclinux, sizeof tioclinux); + if (error != 0) + goto out; + switch (tioclinux) { + case LINUX_TIOCLINUX_KERNMSG: + /* + * XXX needed to not fail for some things. Could + * try to use TIOCCONS, but the char argument + * specifies the VT #, not an fd. + */ + goto out; + case LINUX_TIOCLINUX_COPY: + case LINUX_TIOCLINUX_PASTE: + case LINUX_TIOCLINUX_UNBLANK: + case LINUX_TIOCLINUX_LOADLUT: + case LINUX_TIOCLINUX_READSHIFT: + case LINUX_TIOCLINUX_READMOUSE: + case LINUX_TIOCLINUX_VESABLANK: + case LINUX_TIOCLINUX_CURCONS: /* could use VT_GETACTIVE */ + error = EINVAL; + goto out; + } + break; case LINUX_TIOCGWINSZ: SCARG(&ia, com) = TIOCGWINSZ; break; diff --git a/sys/compat/linux/linux_termios.h b/sys/compat/linux/linux_termios.h index dec7c6ba8be..b1a11e812eb 100644 --- a/sys/compat/linux/linux_termios.h +++ b/sys/compat/linux/linux_termios.h @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_termios.h,v 1.3 1996/04/18 21:21:40 niklas Exp $ */ +/* $OpenBSD: linux_termios.h,v 1.4 2002/05/07 20:23:42 jasoni Exp $ */ #define LINUX_TCGETS _LINUX_IO('T', 1) #define LINUX_TCSETS _LINUX_IO('T', 2) @@ -238,3 +238,14 @@ struct linux_termios { #define LINUX_N_SLIP 1 #define LINUX_N_MOUSE 2 #define LINUX_N_PPP 3 + +/* values passed to TIOCLINUX ioctl */ +#define LINUX_TIOCLINUX_COPY 2 +#define LINUX_TIOCLINUX_PASTE 3 +#define LINUX_TIOCLINUX_UNBLANK 4 +#define LINUX_TIOCLINUX_LOADLUT 5 +#define LINUX_TIOCLINUX_READSHIFT 6 +#define LINUX_TIOCLINUX_READMOUSE 7 +#define LINUX_TIOCLINUX_VESABLANK 10 +#define LINUX_TIOCLINUX_KERNMSG 11 +#define LINUX_TIOCLINUX_CURCONS 12 |