Hi.  On my device I have DirectFB 1.0.0, with a single input driver 
(inputdrivers/keyboard) which has been modified not to use virtual 
terminals, but to directly open /dev/tty0.  On my system, that's the USB 
keyboard.

There is already a system console running over a serial interface 
(/dev/ttyS0) that I use to get at busybox, do command line stuff, etc.  
I have found that there are problems with a variety of programs that 
seem to relate to signal handling and some of the ioctl's associated 
with the terminal, such as:

In DirectFB's keyboard.c after opening /dev/tty0, which works fine...

tcgetpgrp fails - I get ENOTTY errors
tcsetpgrp fails - same

I tried
ioctl(fd, TIOCSCTTY,1)

to see if I could grab a new controlling tty, and it fails with EPERM. 

Looking at the kernel code (I'm on 2.6.16) I see in tty_io.c that 
tcsetpgrp is failing thusly:

    if (!current->signal->tty ||
        (current->signal->tty != real_tty) ||
        (real_tty->session != current->signal->session))
        return -ENOTTY;

So at this point I'm pretty sure that I'm not getting proper signal 
handling (this might explain some other problems I've had) and can't 
seem to acquire the "controlling" tty properly.  Also, I tried playing 
with the O_NOCTTY flag on opening the device, to no effect.

This seems to be a major hurdle needed in order to get a robust enough 
environment to run some of the (very) complicated apps I'm porting to 
directfb.  Any assistance or advice would be greatly appreciated.


_______________________________________________
directfb-dev mailing list
directfb-dev@directfb.org
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev

Reply via email to