>>>>> "John" == John Daily <[EMAIL PROTECTED]> writes:
John> I skimmed through the O'Reilly books on POSIX, and was unable to find any
John> references to setting the controlling terminal. My best guess is that the
John> following comment may be a reference to tcsetpgrp, which can be used to
John> specify the process group in the current session which should be in the
John> "foreground".
John> /* FIXME: According to [EMAIL PROTECTED], there's a cleaner POSIX way
John> * to make a tty the process's controlling tty. */
man setsid, & read sections 9.5 & 9.6 in APUE.
In short, call setsid(), and then open what you want to become your
controlling terminal. If you need to open something else first, specify
O_NOCTTY in open(). This is implied by POSIX as POSIX includes O_NOCTTY. I
don't know if it's explicit or not.
In BSDish systems, you have to explicitly invoke TIOCSCTTY.
What did we do before Stevens published APUE? (Use the Source, Luke!) All
praise Stevens! :)
--
Carson Gaspar -- [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]
http://www.cs.columbia.edu/~carson/home.html
Queen Trapped in a Butch Body