[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Forcing a process to have a new controlling terminal



First open /dev/tty. Then do an TIOCNOTTY ioctl on the file. This will make it so your
process no longer has a controling terminal. Then simply open a terminal-type device. It
will become your controlling terminal (unless you specify otherwise, note the flag to
open(2):

       O_NOCTTY
              If pathname refers to  a  terminal  device  --  see
              tty(4) -- it will not become the process's control­
              ling terminal even if the  process  does  not  have
              one.


Harmon Sequoya Nine wrote:

> Hello.  I'm experimenting with pseudo-terminals, and I cannot find out how, after
> getting a pseudo-terminal how I can make it the controlling terminal (i.e. "/dev/tty")
> of a newly-spawned process.
>
> Can anyone help me out?
>
> TIA
>
> -- Harmon
>
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



--
Jens B. Jorgensen
jjorgens@bdsinc.com



--
To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: