All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Laszlo Ersek <lersek@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Anthony Liguori <aliguori@us.ibm.com>,
	qemu-devel@nongnu.org, Brad Smith <brad@comstyle.com>
Subject: Re: [Qemu-devel] [PATCH for-1.5] portability: pty.h is glibc-specific
Date: Tue, 14 May 2013 13:59:46 -0600	[thread overview]
Message-ID: <519297B2.1040107@redhat.com> (raw)
In-Reply-To: <51929059.5090102@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 1300 bytes --]

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:
http://austingroupbugs.net/view.php?id=508

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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]

  reply	other threads:[~2013-05-14 19:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14 12:05 [Qemu-devel] [PATCH for-1.5] portability: pty.h is glibc-specific Paolo Bonzini
2013-05-14 16:10 ` Anthony Liguori
2013-05-14 16:15   ` Brad Smith
2013-05-14 16:28     ` Anthony Liguori
2013-05-14 16:35     ` Paolo Bonzini
2013-05-14 19:28       ` Laszlo Ersek
2013-05-14 19:59         ` Eric Blake [this message]
2013-05-14 18:30 ` Brad Smith
2013-05-14 21:06   ` Peter Maydell
2013-05-14 19:34 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=519297B2.1040107@redhat.com \
    --to=eblake@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=brad@comstyle.com \
    --cc=lersek@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.