tty manipulation

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Devi reman
    New Member
    • Jul 2010
    • 2

    tty manipulation

    I need to replicate a key press twice so that the action assocated with key press occurs in a single shot. the belwo code i have implemented for the same.
    Code:
    fd = open("/dev/pts/10", O_RDONLY); 
    if(fd==-1) 
    { 
     return(0);  
    } 
    simulate_key = -K_F2; 
    rc = ioctl(fd, TIOCSTI,simulate)
    close(fd);
    but while running i am getting error after the ioctl command that "A file descriptor does not represent an open file"

    Thanks in advance
Working...