The unix book contains some information.
Are you sure that f[0] is the slave side of the pty pair?
/ Niels Möller ()
Previous text:
2003-02-15 15:28: Subject: setsid
Hmm. I don't think so. Not that it stopped me from testing. :)
TTY stuff is not something I've looked closely at before either.
In make_ptypair a free PTY and and the corresponding TTY is aquired and returned as f[0] and f[1] respectively.
The controlling terminal is set to the (slave) TTY with setsid.
Around here it gets fuzzy. I wounder if the is a UNIX course on Uni that handles TTY/PTY programming.
/ Peter Bortas