Subject: lib/6560: openpty() too restrictive about what you can do
To: None <firstname.lastname@example.org>
From: None <email@example.com>
Date: 12/10/1998 09:51:03
>Synopsis: openpty() too restrictive about what you can do
>Responsible: lib-bug-people (Library Bug People)
>Arrival-Date: Thu Dec 10 07:05:01 1998
>Originator: Todd Vierling
DuhNet: Pointing out the obvious since 1994.
>Release: -current "post-1.3 or so"
System: NetBSD duhnet.net 1.3I NetBSD 1.3I (DUH) #0: Wed Nov 25 14:19:32 EST 1998 firstname.lastname@example.org:/usr/SRC/netbsd/src/sys/arch/alpha/compile/DUH alpha
The openpty() function exists to abstract the functions of
(1) finding a free tty/pty pair,
(2) opening the master pty and checking whether the slave side is free, and
(3) opening the slave tty.
These functions in the current implementation are indivisible.
Unfortunately, programs which need the ability to do (1) and (2) at one
point and (3) later cannot be converted to use openpty(), as the program
would need to hold the slave side open as returned by openpty() (once the
last slave side fd closes, the master goes away).
Attempt to convert, say, screen to use openpty().
IMHO, openpty() should accept a NULL pointer to its `aslave' argument,
which should mean `do not open the slave device'. Since the `name'
pointer will return the device to open as slave, this should be a rather
trivial functionality addition.