According to Richard B. Johnson:
> I'm checking on it now. Here's a strace with setsid() ahead, same
> problem:

Yes, sessions, process groups, and controlling ttys are weird
and hard to understand. And probably braindamaged as well, if
not, it's what they cause anyway ;)

If you want to forcibly get a controlling tty:

/* Make sure we do not have a controlling tty. */
ioctl(0, TIOCNOTTY, 0);
close(0);
close(1);
close(2);

/* Become session leader */
setsid();

/* Open tty which will become new controlling tty. */
open("/dev/tty1", O_RDWR);
dup(0);
dup(0);

/* Just to be sure, force controlling tty, in case /dev/tty1
   was the ctty for another process. Only root may do this! */
ioctl(0, TIOCSCTTY, 1);

Mike.
-- 
Deadlock, n.:
        Deceased rastaman.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/

Reply via email to