[PATCH] getpt: use /dev/pts/ptmx as default ptmx master
Zack Weinberg
zackw@panix.com
Thu Mar 15 14:03:00 GMT 2018
On Thu, Mar 15, 2018 at 8:06 AM, Christian Brauner
<christian.brauner@ubuntu.com> wrote:
> For a long time now Linux has placed the ptmx character device directly
> under the devpts mount at /dev/pts/ptmx.
Exactly which kernel version started doing this?
> It is time to start switching to using /dev/pts/ptmx and use /dev/ptmx as a
> fallback only.
Application code is entitled to do open ('/dev/ptmx", O_RDWR) itself
rather than calling posix_openpt. It is not OK to break those
applications. That was the recommended practice prior to the
introduction of posix_openpt, and I am suspicious of posix_openpt not
existing on still-reasonable portability targets.
Since /dev/ptmx must stick around for the sake of those applications,
I am inclined to say that libc's posix_openpt should continue using
/dev/ptmx as well, in order to ensure that that configuration
continues to be tested. I am also inclined to say that, on new
kernels where the devpts filesystem provides the ptmx node, using a
bind-mount rather than a symlink for /dev/ptmx is a misconfiguration
(and on older kernels, obviously it needs to be an actual device
node).
zw
More information about the Libc-alpha
mailing list