aboutsummaryrefslogtreecommitdiffstats
path: root/fbmngplay/console.c
blob: 8bc7991fd06ebbf2b289319509ab2d5b982b1a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
 *	fbmngplay - framebuffer console MNG player.
 *	(c) 2001-2002 by Stefan Reinauer, <stepan@suse.de>
 *   
 *	This program is based on mngplay, part of libmng, written and (C) by
 *	Ralph Giles <giles@ashlu.bc.ca>
 *
 *	This program my be redistributed under the terms of the
 *	GNU General Public Licence, version 2, or at your preference,
 *	any later version.
 */

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <linux/kd.h>
#include <linux/vt.h>
#include <sys/ioctl.h>

#include "console.h"

int start_console = 0;
int fd;

int current_console(void)
{
	int  result=0;
	char twelve=12;

	result = ioctl(fd, TIOCLINUX, &twelve);

	return result;
}

void init_consoles(void)
{
	fd=open("/dev/tty0", O_RDWR|O_NDELAY);
	if (fd<0) {
		fprintf(stderr, "Could not open virtual terminal.\n");
		exit (1);
	}
}