For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > August 2006 > TIOCSCTTY (Re: Does this mean I suck?)









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author TIOCSCTTY (Re: Does this mean I suck?)
Valentin Nechayev

2006-08-25, 7:00 pm

Wed, Aug 16, 2006 at 08:04:56, cdalten (K-mart Cashier) wrote about "Does this mean I suck?":

KmC> fd = open("/dev/tty",O_RDWR, 0);

KmC> if(setsid() < 0)
KmC> fprintf(stderr, "setsid error \n");

KmC> if( (ioctl(fd, TIOCSCTTY, NULL)) < 0)
KmC> fprintf(stderr, "error \n");

The terminal you try to attach already has alive session. You can't
attach terminal while current session is alive. Revoke the terminal
first, then try.


-netch-
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com