repo.or.cz
/
fbsplash.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
core: remove reference to a non-existing field of the theme struct
[fbsplash.git]
/
misc
/
kbd
/
fgconsole.c
blob
f31289b1796d02580c0872bd23d0266f2f6b3858
1
/*
2
* fgconsole.c - aeb - 960123 - Print foreground console
3
*/
4
#include <stdio.h>
5
#include <stdlib.h>
6
#include <sys/ioctl.h>
7
#include <linux/vt.h>
8
#include
"getfd.h"
9
10
int
11
main
(
int
argc
,
char
**
argv
){
12
int
fd
;
13
struct
vt_stat vtstat
;
14
15
fd
=
getfd
(
NULL
);
16
if
(
ioctl
(
fd
,
VT_GETSTATE
, &
vtstat
)) {
17
perror
(
"fgconsole: VT_GETSTATE"
);
18
exit
(
1
);
19
}
20
printf
(
"%d
\n
"
,
vtstat
.
v_active
);
21
return
0
;
22
}