pty pairs in POSIX with devpts

Pete Wyckoff (pw@dancer.ca.sandia.gov)
Thu, 16 Apr 1998 15:10:07 -0700


Can someone explain the POSIX-ly correct way to open pseudo-tty pairs?

There's the good old BSD method which involves searching through all
/dev/pty[p-za-e][0-9a-f], and assuming the slave side is named "ttyXX".
Hopefully that's not it.

Then there's the SVR4 way, which uses "/dev/ptmx", grantpt(), unlockpt(),
and ptsname(), which don't appear in glibc-2.0.6.

I've tried using the devpts filesystem and "/dev/pts/<minor>" for opening
the slave, which seems to work fine, but wonder if I should trust that
it'll be common for users to have /dev/pts mounted, with the correct
permissions. (It's still experimental in late 2.1 kernels.)

Suggestions?
-- Pete
-----------------------------------------------------
Pete Wyckoff | wyckoff@ca.sandia.gov
Sandia National Laboratories | 510 294 3503 (voice)
MS 9011, P.O. Box 969 | 510 294 1225 (fax)
Livermore, CA 94551 |

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu