Subject: Re: unexpected behaviour of grantpt(3)
To: None <tech-kern@netbsd.org>
From: Christos Zoulas <christos@astron.com>
List: tech-kern
Date: 02/18/2006 20:18:49
In article <20060218170427.GA24108@britannica.bec.de>,
 <joerg@britannica.bec.de> wrote:
>On Sat, Feb 18, 2006 at 05:42:01PM +0100, Klaus Heinz wrote:
>> > The real question for me is why do you mix openpty and grantpt at all?
>> > You should use posix_openpt and grantpt for this purpose.
>> 
>> Don't shoot the messenger. IO-Tty uses openpty and grantpt this way, I
>> am only trying to make it work on NetBSD again.
>
>Sorry, this was a "you == source code author", nothing personal.
>
>> From what I found on the web, Linux, FreeBSD, OpenBSD, NetBSD (since 3.0),
>> Solaris and AIX support posix_openpt() and grantpt(), so I will probably 
>> propose this route to the author(s). Meanwhile I will add a patch for
>> NetBSD to pkgsrc which is as unintrusive as possible.
>
>Behaviour should be to use posix_openpt + grantpt if available and
>otherwise fallback to openpty. The latter provides the same
>functionality, but should require root permissions.

Openpty() only needs root permissions if /dev/ptm is not available.

christos