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
signature.asc
Description: OpenPGP digital signature