/[baselayout]/trunk/src/consoletype.c
Gentoo

Contents of /trunk/src/consoletype.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 345 - (show annotations) (download) (as text)
Sun Apr 6 16:28:27 2003 UTC (16 years ago) by azarah
File MIME type: text/x-csrc
File size: 492 byte(s)
various fixes; moved .c files to src

1 #include <stdio.h>
2 #include <string.h>
3 #include <sys/ioctl.h>
4 #include <sys/stat.h>
5 #include <sys/sysmacros.h>
6
7 int main(int argc, char **argv)
8 {
9 unsigned char twelve = 12;
10 int maj;
11 struct stat sb;
12
13 fstat(0, &sb);
14 maj = major(sb.st_rdev);
15 if (maj != 3 && (maj < 136 || maj > 143)) {
16 if (ioctl (0, TIOCLINUX, &twelve) < 0) {
17 printf ("serial\n");
18 return 1;
19 } else {
20 printf ("vt\n");
21 return 0;
22 }
23 } else {
24 printf ("pty\n");
25 return 2;
26 }
27 }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.20