The Devpts Filesystem¶
Each mount of the devpts filesystem is now distinct such that ptysand their indices allocated in one mount are independent from ptysand their indices in all other mounts.
All mounts of the devpts filesystem now create a/dev/pts/ptmx nodewith permissions0000.
To retain backwards compatibility the a ptmx device node (aka any nodecreated withmknodnamec52) when opened will look for an instanceof devpts under the namepts in the same directory as the ptmx devicenode.
As an option instead of placing a/dev/ptmx device node at/dev/ptmxit is possible to place a symlink to/dev/pts/ptmx at/dev/ptmx orto bind mount/dev/ptx/ptmx to/dev/ptmx. If you opt for usingthe devpts filesystem in this manner devpts should be mounted withtheptmxmode=0666, orchmod0666/dev/pts/ptmx should be called.
Total count of pty pairs in all instances is limited by sysctls:
kernel.pty.max = 4096 - global limitkernel.pty.reserve = 1024 - reserved for filesystems mounted from the initial mount namespacekernel.pty.nr - current count of ptys
Per-instance limit could be set by adding mount optionmax=<count>.
This feature was added in kernel 3.4 together withsysctlkernel.pty.reserve.
In kernels older than 3.4 sysctlkernel.pty.max works as per-instance limit.