patch-1.3.96 linux/arch/sparc/kernel/sunos_ioctl.c
Next file: linux/arch/sparc/kernel/sys_sparc.c
Previous file: linux/arch/sparc/kernel/sparc-stub.c
Back to the patch index
Back to the overall index
- Lines: 52
- Date:
Thu Apr 25 13:22:05 1996
- Orig file:
v1.3.95/linux/arch/sparc/kernel/sunos_ioctl.c
- Orig date:
Wed Apr 24 17:00:35 1996
diff -u --recursive --new-file v1.3.95/linux/arch/sparc/kernel/sunos_ioctl.c linux/arch/sparc/kernel/sunos_ioctl.c
@@ -1,4 +1,4 @@
-/* $Id: sunos_ioctl.c,v 1.18 1996/04/04 12:41:38 davem Exp $
+/* $Id: sunos_ioctl.c,v 1.20 1996/04/25 06:09:08 davem Exp $
* sunos_ioctl.c: The Linux Operating system: SunOS ioctl compatibility.
*
* Copyright (C) 1995 Miguel de Icaza (miguel@nuclecu.unam.mx)
@@ -139,8 +139,43 @@
*/
return 0;
/* Non posix grp */
- case _IOR('t', 119, int):
- return -EIO;
+ case _IOW('t', 118, int): {
+ int oldval, *ptr;
+
+ cmd = TIOCSPGRP;
+ ptr = (int *) arg;
+ oldval = verify_area(VERIFY_WRITE, ptr, sizeof(int));
+ if(oldval)
+ return oldval;
+ oldval = *ptr;
+ foo = sys_ioctl(fd, cmd, arg);
+ if(*ptr == -1) {
+ *ptr = oldval;
+ foo = -EIO;
+ }
+ if(foo == -ENOTTY)
+ foo = -EIO;
+ return foo;
+ }
+
+ case _IOR('t', 119, int): {
+ int oldval, *ptr;
+
+ cmd = TIOCGPGRP;
+ ptr = (int *) arg;
+ oldval = verify_area(VERIFY_WRITE, ptr, sizeof(int));
+ if(oldval)
+ return oldval;
+ oldval = *ptr;
+ foo = sys_ioctl(fd, cmd, arg);
+ if(*ptr == -1) {
+ *ptr = oldval;
+ foo = -EIO;
+ }
+ if(foo == -ENOTTY)
+ foo = -EIO;
+ return foo;
+ }
}
#if 0
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this