[Top][All Lists]

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

Re: [Qemu-devel] [PATCH for-1.5] portability: pty.h is glibc-specific

From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH for-1.5] portability: pty.h is glibc-specific
Date: Tue, 14 May 2013 13:59:46 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130402 Thunderbird/17.0.5

On 05/14/2013 01:28 PM, Laszlo Ersek wrote:

> Not to argue with this, just a general note: most of whatever is
> portable from the terminal IO interfaces belongs into <termios.h> indeed.
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/termios.h.html
> Traditionally nonportable stuff related to pty allocation and
> master-slave pairing has been "recently" standardized as well (as in,
> SUSv3 / UNIX 03):
> http://pubs.opengroup.org/onlinepubs/9699919799/functions/posix_openpt.html
> (+grantpt, ptsname, unlockpt; they seem to date back to SUSv1 / UNIX 95)
> CC'ing Eric for the obligatory POSIX sanity check... :)

Looks accurate.

Still missing from POSIX is ptsname_r, although it might appear in the
next revision ("Issue 8") in a few years:

which means right now, POSIX has no thread-safe mechanism for
determining the slave name after opening a master pty.

Personally, I find the high-level BSD openpty() interface a lot nicer to
use than the POSIX posix_openpt()/grantpt()/unlockpt()/ptsname()
sequence, but it may come with its own pitfalls since it is not
standardized (yet).

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]