Section 20.3. Determining Whether the Terminal Is a VC

   


20.3. Determining Whether the Terminal Is a VC

To find out whether the current terminal is a VC, you can open /dev/tty and use VT_GETMODE to query the mode:

 struct vt_mode vtmode;  fd = open("/dev/tty", O_RDWR);  retval = ioctl(fd, VT_GETMODE, &vtmode);  if (retval < 0) {      /* This terminal is not a VC; take appropriate action */  } 



       
    top
     


    Linux Application Development
    Linux Application Development (paperback) (2nd Edition)
    ISBN: 0321563220
    EAN: 2147483647
    Year: 2003
    Pages: 168

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net