2 * Copyright (c) 1999-2003 Red Hat, Inc. All rights reserved.
4 * This software may be freely redistributed under the terms of the GNU
7 * You should have received a copy of the GNU General Public License
8 * along with this program; if not, write to the Free Software
9 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 #include <sys/ioctl.h>
19 #include <sys/sysmacros.h>
21 int main(int argc, char **argv)
23 unsigned char twelve = 12;
25 int maj, min, ret = 0, fg = -1;
29 maj = major(sb.st_rdev);
30 min = minor(sb.st_rdev);
31 if (maj != 3 && (maj < 136 || maj > 143)) {
32 if ((fg = ioctl (0, TIOCLINUX, &twelve)) < 0) {
40 fd = open("/proc/tty/drivers",O_RDONLY);
42 if (strstr(buf,"vioconsole /dev/tty")) {
58 if (argc > 1 && !strcmp(argv[1],"fg")) {
59 if (fg < 0 || fg != (min-1))