Unix Programming - TIOCSCTTY (Re: Does this mean I suck?)

This is Interesting: Free IT 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:28 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






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com