Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754091AbdHXX1c (ORCPT ); Thu, 24 Aug 2017 19:27:32 -0400 Received: from mail-oi0-f53.google.com ([209.85.218.53]:35655 "EHLO mail-oi0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753973AbdHXX1a (ORCPT ); Thu, 24 Aug 2017 19:27:30 -0400 MIME-Version: 1.0 In-Reply-To: <877exs7epb.fsf@xmission.com> References: <20170816171211.4021-1-christian.brauner@ubuntu.com> <87ziazqdfr.fsf@xmission.com> <20170824022436.44adb497@mir> <87378hhi3y.fsf@xmission.com> <87wp5tfynr.fsf@xmission.com> <20170824062432.1e05e6f8@mir> <874lsxezal.fsf@xmission.com> <87y3q8ermg.fsf@xmission.com> <874lswae8b.fsf@xmission.com> <877exs7epb.fsf@xmission.com> From: Linus Torvalds Date: Thu, 24 Aug 2017 16:27:29 -0700 X-Google-Sender-Auth: r8IJMH3hJ1AYiwhq53atb2Spqu0 Message-ID: Subject: Re: [PATCH 0/1] devpts: use dynamic_dname() to generate proc name To: "Eric W. Biederman" Cc: Christian Brauner , Al Viro , Serge Hallyn , Stefan Lippers-Hollmann , Christian Brauner , Thorsten Leemhuis , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2821 Lines: 82 On Thu, Aug 24, 2017 at 4:01 PM, Eric W. Biederman wrote: > Linus Torvalds writes: > >> On Thu, Aug 24, 2017 at 1:43 PM, Eric W. Biederman >> wrote: >>> >>> There are just enough weird one off scripts like xen image builder (I >>> think that was the nasty test case that broke in debian) that I can't >>> imagine ever being able to responsibly remove the path based lookups in >>> /dev/ptmx. I do dream of it sometimes. >> >> Not going to happen. > > Which is what I said. Yes, but you then went on to say that we should encourage "/dev/pts/ptmx" Which is BS. It's not a standard location, and it doesn't have any advantages. It was a bad idea and due to a bad implementation. We fixed it. Let it go. >> The fact is, /dev/ptmx is the simply the standard location. >> /dev/pts/ptmx simply is *not*. > > The standard is posix_openpt(). That is a syscall on the bsds. > Opening something called ptmx at this point is a Linuxism. Bzzt. Thank you for playing, but you're completely and utterly wrong. Look around a bit more. posix_openpt() may be what you *wish* the standard was, but no, /dev/ptmx is not a linuxism. Really. It's the SysV STREAMS standard location, and it is what Sysv pty users _will_ use directly. Linux didn't make up that name. Solaris, HP-UX-11, other sysv code bases all use /dev/ptmx The whole "posix_openpt()" thing came later, in an attempt to just unify the BSD and Sysv models. Just google for "streams pty" if you don't believe me. So really. The only linuxism here is that stupid /dev/pts/ptmx. > There are a lot of programs that are going to be calling posix_openpt() > simply because /dev/ptmx can not be counted on to exist. .. and there are probably even more programs that simply use "/dev/ptmx". If you came from a sysv world, or if you just happened to copy any of the hundreds of examples on the interenet, that's what you would do. Christ, just go to Wikipedia. And I quote: 'BSD PTYs have been rendered obsolete by Unix98 ptys whose naming system does not limit the number of pseudo-terminals and access to which occurs without danger of race conditions. /dev/ptmx is the "pseudo-terminal master multiplexer". Opening it returns a file descriptor of a master node and causes an associated slave node /dev/pts/N to be created.[5]' That's from https://en.wikipedia.org/wiki/Pseudoterminal so stop blathering garbage. The fact is, /dev/ptmx is the standard location, and /dev/pts/ptmx is, and always has been, an abomination. Now, if you want to be portable, "posix_openpt()" is indeed what you should use, but that doesn't change the basic point. There's a very real reason why people use "/dev/ptmx", and no, it's not a linuxism. Linus