From: rsalz@osf.org (Rich Salz)
Subject: Re: /dev/ptm
Date: Tue, 22 Dec 1992 19:02:42 GMT [thread overview]
Message-ID: <1992Dec22.190242.17498@osf.org> (raw)
In-Reply-To: 1992Dec22.091437.11429@dcs.warwick.ac.uk
In <1992Dec22.091437.11429@dcs.warwick.ac.uk> rince@dcs.warwick.ac.uk (James Bonfield) writes:
>Hello,
> Why does the 'script' command allocate itself a new controlling tty
>and yet no other 'standard' (eg emacs, fep) program seem able to?
Look at pty_master(3) and pty_slave(3). You want to do something like
this, I believe:
int m, s;
struct winsize win;
struct termios tt;
m = pty_master();
tcgetattr(0, &tt);
ioctl(0, TIOCGWINSZ, &win);
if (fork == 0) {
s = pty_slave(m);
tcsetattr(s, TCSANOW, &win);
ioctl(s, TIOCSWINSZ, &win);
setsid();
ioctl(s, TIOCSTTY, 0);
}
There is a nice section on controlling terminals in tty(7).
/r$
next parent reply other threads:[~1992-12-22 19:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1992Dec22.091437.11429@dcs.warwick.ac.uk>
1992-12-22 19:02 ` Rich Salz [this message]
1992-12-31 3:28 ` /dev/ptm Michael Meissner
read-only archive
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox