Magellan Linux

Contents of /trunk/linterm_tools/fw_builder/bootsplash/console.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 658 - (show annotations) (download)
Mon Jan 14 16:57:24 2008 UTC (16 years, 3 months ago) by niro
File MIME type: text/plain
File size: 875 byte(s)
initial import

1 /*
2 * fbmngplay - framebuffer console MNG player.
3 * (c) 2001-2002 by Stefan Reinauer, <stepan@suse.de>
4 *
5 * This program is based on mngplay, part of libmng, written and (C) by
6 * Ralph Giles <giles@ashlu.bc.ca>
7 *
8 * This program my be redistributed under the terms of the
9 * GNU General Public Licence, version 2, or at your preference,
10 * any later version.
11 */
12
13 #include <stdio.h>
14 #include <stdlib.h>
15 #include <unistd.h>
16 #include <fcntl.h>
17 #include <errno.h>
18 #include <linux/kd.h>
19 #include <linux/vt.h>
20 #include <sys/ioctl.h>
21
22 #include "console.h"
23
24 int start_console = 0;
25 int fd;
26
27 int current_console(void)
28 {
29 int result = 0;
30 char twelve = 12;
31
32 result = ioctl(fd, TIOCLINUX, &twelve);
33
34 return result;
35 }
36
37 void init_consoles(void)
38 {
39 fd = open("/dev/tty0", O_RDWR | O_NDELAY);
40 if (fd < 0) {
41 fprintf(stderr, "Could not open virtual terminal.\n");
42 exit(1);
43 }
44 }