Skip to contentSkip to conversation

vt ioctl to get new vt requested by change_console?

PATCH Scott McDermott 1 participant 1 message Mar 30, 2002

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Would anyone consider this patch? I don't know how else to get this info from a user program. I want to use VT_RELDISP ioctl to say it's not ok to do a VT switch, based on which VT was requested for activation. This information is not otherwise available.

drivers/char/vt.c +4 -0
diff -ur linux-2.4.19-pre4/drivers/char/vt.c linux-2.4.19-pre4.new/drivers/char/vt.c
@@ -735,6 +735,10 @@
 		return copy_to_user((void*)arg, &(vt_cons[console]->vt_mode), 
 							sizeof(struct vt_mode)) ? -EFAULT : 0; 
 
+	case VT_GETNEWVT:
+		return copy_to_user((void*)arg, &(vt_cons[console]->vt_newvt), 
+							sizeof(int)) ? -EFAULT : 0; 
+
 	/*
 	 * Returns global vt state. Note that VT 0 is always open, since
 	 * it's an alias for the current VT, and people can't use it here.
include/linux/vt.h +2 -0
diff -ur linux-2.4.19-pre4/include/linux/vt.h linux-2.4.19-pre4.new/include/linux/vt.h
@@ -51,4 +51,6 @@
 #define VT_LOCKSWITCH   0x560B  /* disallow vt switching */
 #define VT_UNLOCKSWITCH 0x560C  /* allow vt switching */
 
+#define VT_GETNEWVT	0x560D	/* which vt has yet to complete VT_ACTIVATE */
+
 #endif /* _LINUX_VT_H */