Subject: Re: /dev/ptmx
To: None <>
List: tech-kern
Date: 05/24/2004 20:49:39
From: matthew green <>
Subject: re: /dev/ptmx 
Date: Mon, 24 May 2004 11:59:30 +1000
Message-ID: <>

>    1. Add /dev/ptm like OpenBSD has.
>    2. Optionally add /dev/ptmx for Posix compatibility that works like above.
> i think it's important to support "unix98 ptys"(?), which is 2., right?

(slightly off-topic...)
BTW, does POSIX (or single unix specification) really specify /dev/ptmx?

As far as I know, POSIX 2001 specifies only posix_openpt(),
not /dev/ptmx, and any earlier versions of POSIX/SUS say nothing
how to open the pty master.
I only find the mention of /dev/ptmx at the rationale section of
posix_openpt() in POSIX 2001:

    On implementations supporting the /dev/ptmx clone device, opening the
    master device of a pseudo-terminal is simply:

    mfdp = open("/dev/ptmx", oflag );
    if (mfdp < 0)
        return -1;

It would seem that /dev/ptmx is not a part of the standard.

Does anyone know about the prehistory why it is called "unix98 ptys"?
I have discussed it with Soda-san, but we could not come to a conclusion.
(I suspect it is the Linux dialect.)

Of course, I think it is better to suport /dev/ptmx for the compatibility
to SystemV UNIXen and Linux.  (although open("/dev/ptmx"...) can easily be
replaced with posix_openpt()...)