vt_ioctl.c (ef11f1b76a59833cfadbe88a9513ca01b14a2b88) | vt_ioctl.c (dce05aa6eec977f1472abed95ccd71276b9a3864) |
---|---|
1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 1992 obz under the linux copyright 4 * 5 * Dynamic diacritical handling - aeb@cwi.nl - Dec 1993 6 * Dynamic keymap and string allocation - aeb@cwi.nl - May 1994 7 * Restrict VT switching via ioctl() - grif@cs.ucr.edu - Dec 1995 8 * Some code moved for less code duplication - Andi Kleen - Mar 1997 --- 29 unchanged lines hidden (view full) --- 38#include <linux/vt_kern.h> 39#include <linux/kbd_diacr.h> 40#include <linux/selection.h> 41 42char vt_dont_switch; 43extern struct tty_driver *console_driver; 44 45#define VT_IS_IN_USE(i) (console_driver->ttys[i] && console_driver->ttys[i]->count) | 1// SPDX-License-Identifier: GPL-2.0 2/* 3 * Copyright (C) 1992 obz under the linux copyright 4 * 5 * Dynamic diacritical handling - aeb@cwi.nl - Dec 1993 6 * Dynamic keymap and string allocation - aeb@cwi.nl - May 1994 7 * Restrict VT switching via ioctl() - grif@cs.ucr.edu - Dec 1995 8 * Some code moved for less code duplication - Andi Kleen - Mar 1997 --- 29 unchanged lines hidden (view full) --- 38#include <linux/vt_kern.h> 39#include <linux/kbd_diacr.h> 40#include <linux/selection.h> 41 42char vt_dont_switch; 43extern struct tty_driver *console_driver; 44 45#define VT_IS_IN_USE(i) (console_driver->ttys[i] && console_driver->ttys[i]->count) |
46#define VT_BUSY(i) (VT_IS_IN_USE(i) || i == fg_console || vc_cons[i].d == sel_cons) | 46#define VT_BUSY(i) (VT_IS_IN_USE(i) || i == fg_console || vc_is_sel(vc_cons[i].d)) |
47 48/* 49 * Console (vt and kd) routines, as defined by USL SVR4 manual, and by 50 * experimentation and study of X386 SYSV handling. 51 * 52 * One point of difference: SYSV vt's are /dev/vtX, which X >= 0, and 53 * /dev/console is a separate ttyp. Under Linux, /dev/tty0 is /dev/console, 54 * and the vc start at /dev/ttyX, X >= 1. We maintain that here, so we will --- 816 unchanged lines hidden (view full) --- 871 v.v_cols = cols; 872 } 873 } 874 875 if (v.v_clin > 32) 876 return -EINVAL; 877 878 for (i = 0; i < MAX_NR_CONSOLES; i++) { | 47 48/* 49 * Console (vt and kd) routines, as defined by USL SVR4 manual, and by 50 * experimentation and study of X386 SYSV handling. 51 * 52 * One point of difference: SYSV vt's are /dev/vtX, which X >= 0, and 53 * /dev/console is a separate ttyp. Under Linux, /dev/tty0 is /dev/console, 54 * and the vc start at /dev/ttyX, X >= 1. We maintain that here, so we will --- 816 unchanged lines hidden (view full) --- 871 v.v_cols = cols; 872 } 873 } 874 875 if (v.v_clin > 32) 876 return -EINVAL; 877 878 for (i = 0; i < MAX_NR_CONSOLES; i++) { |
879 struct vc_data *vcp; 880 | |
881 if (!vc_cons[i].d) 882 continue; 883 console_lock(); | 879 if (!vc_cons[i].d) 880 continue; 881 console_lock(); |
884 vcp = vc_cons[i].d; 885 if (vcp) { 886 if (v.v_vlin) 887 vcp->vc_scan_lines = v.v_vlin; 888 if (v.v_clin) 889 vcp->vc_font.height = v.v_clin; 890 vcp->vc_resize_user = 1; 891 vc_resize(vcp, v.v_cols, v.v_rows); 892 } | 882 if (v.v_vlin) 883 vc_cons[i].d->vc_scan_lines = v.v_vlin; 884 if (v.v_clin) 885 vc_cons[i].d->vc_font.height = v.v_clin; 886 vc_cons[i].d->vc_resize_user = 1; 887 vc_resize(vc_cons[i].d, v.v_cols, v.v_rows); |
893 console_unlock(); 894 } 895 break; 896 } 897 898 case PIO_FONT: { 899 if (!perm) 900 return -EPERM; --- 550 unchanged lines hidden --- | 888 console_unlock(); 889 } 890 break; 891 } 892 893 case PIO_FONT: { 894 if (!perm) 895 return -EPERM; --- 550 unchanged lines hidden --- |